Skip to content

Instantly share code, notes, and snippets.

@nathanpeck
Created June 6, 2018 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanpeck/209c6ed955dd865a91c9675df1c78468 to your computer and use it in GitHub Desktop.
Save nathanpeck/209c6ed955dd865a91c9675df1c78468 to your computer and use it in GitHub Desktop.
# A role for the service so it can access the tables
ChatServiceRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Principal:
Service: "ecs-tasks.amazonaws.com"
Action: ['sts:AssumeRole']
Path: /
Policies:
- PolicyName: users-dynamodb-table
PolicyDocument:
Statement:
- Effect: Allow
Action:
- "dynamodb:PutItem"
- "dynamodb:GetItem"
- "dynamodb:Query"
- "dynamodb:Scan"
- "dynamodb:UpdateItem"
- "dynamodb:DeleteItem"
Resource:
- !Join ['', ['arn:aws:dynamodb:*:*:table/', !Ref 'UsersTable']]
- !Join ['', ['arn:aws:dynamodb:*:*:table/', !Ref 'MessagesTable']]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment