Skip to content

Instantly share code, notes, and snippets.

@adrianhall
Last active December 17, 2018 22:29
Show Gist options
  • Save adrianhall/10df39800af0e8fe2a231d29af4c4410 to your computer and use it in GitHub Desktop.
Save adrianhall/10df39800af0e8fe2a231d29af4c4410 to your computer and use it in GitHub Desktop.
#=======================================================================================
AuthRole:
Type : AWS::IAM::Role
Description : "Role that the an authenticated user assumes"
Properties:
RoleName : ${self:provider.apiname}-auth
AssumeRolePolicyDocument:
Version : "2012-10-17"
Statement:
- Effect : Allow
Principal:
Federated : cognito-identity.amazonaws.com
Action : sts:AssumeRoleWithWebIdentity
Condition:
ForAnyValue:StringLike:
"cognito-identity.amazonaws.com:amr": "authenticated"
#=======================================================================================
UnAuthRole:
Type : AWS::IAM::Role
Description : "Role that the an authenticated user assumes"
Properties:
RoleName : ${self:provider.apiname}-unauth
AssumeRolePolicyDocument:
Version : "2012-10-17"
Statement:
- Effect : Allow
Principal:
Federated : cognito-identity.amazonaws.com
Action : sts:AssumeRoleWithWebIdentity
Condition:
ForAnyValue:StringLike:
"cognito-identity.amazonaws.com:amr": "unauthenticated"
#=======================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment