Skip to content

Instantly share code, notes, and snippets.

@adrianhall
Last active December 17, 2018 22:29
Show Gist options
  • Save adrianhall/5fb9e77d4b178aaa1ebab7fb0e315bd9 to your computer and use it in GitHub Desktop.
Save adrianhall/5fb9e77d4b178aaa1ebab7fb0e315bd9 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"
Policies:
- PolicyName : ${self:provider.apiname}-auth-appsync
PolicyDocument:
Version : "2012-10-17"
Statement:
- Effect : Allow
Action : appsync:GraphQL
Resource:
- { Fn::Join: [ '', [ { Ref: GraphQlApi }, '/types/Query/fields/*' ] ] }
- { Fn::Join: [ '', [ { Ref: GraphQlApi }, '/types/Subscription/fields/*' ] ] }
- { Fn::Join: [ '', [ { Ref: GraphQlApi }, '/types/Mutation/fields/updateUser' ] ] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment