Skip to content

Instantly share code, notes, and snippets.

@jsonw23
Created June 23, 2020 17:08
Show Gist options
  • Save jsonw23/6cca46d1f6df6686f0383aa3d0b399c6 to your computer and use it in GitHub Desktop.
Save jsonw23/6cca46d1f6df6686f0383aa3d0b399c6 to your computer and use it in GitHub Desktop.
Add an IAM policy so the DynamoDB table can be scanned
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: hello_world/
Handler: app.lambda_handler
Runtime: python3.8
Environment:
Variables:
TABLE_NAME: !Ref MyTable
# grant permission to the table using a policy template
Policies:
- DynamoDBReadPolicy
TableName: !Ref MyTable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment