Created
April 13, 2018 22:20
-
-
Save adrianhall/46dc9bd1d4effff96e35d53aad077f4c to your computer and use it in GitHub Desktop.
A CloudFormation template for the AppSync DynamoDB access role.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DynamoDBRole: | |
Type: AWS::IAM::Role | |
Properties: | |
RoleName: !Sub ${APIName}-appsync-dynamodb-role | |
ManagedPolicyArns: | |
- Ref: AppSyncDynamoDBPolicy | |
AssumeRolePolicyDocument: | |
Version: 2012-10-17 | |
Statement: | |
- Effect: Allow | |
Action: | |
- sts:AssumeRole | |
Principal: | |
Service: | |
- appsync.amazonaws.com | |
DependsOn: | |
- AppSyncDynamoDBPolicy | |
AppSyncDynamoDBPolicy: | |
Type: AWS::IAM::ManagedPolicy | |
Properties: | |
Description: Managed policy to allow AWS AppSync to access the tables created by this template. | |
Path: /appsync/ | |
PolicyDocument: | |
Version: 2012-10-17 | |
Statement: | |
- Effect: Allow | |
Action: | |
- dynamodb:GetItem | |
- dynamodb:PutItem | |
- dynamodb:DeleteItem | |
- dynamodb:UpdateItem | |
- dynamodb:Query | |
- dynamodb:Scan | |
- dynamodb:BatchGetItem | |
- dynamodb:BatchWriteItem | |
Resource: !Join [ "", [ !GetAtt DynamoDBNotesTable.Arn, "*" ] ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment