Created
July 21, 2017 11:28
-
-
Save harrietty/f0e5c83abc7c145f6ceaa3a5eb3707e9 to your computer and use it in GitHub Desktop.
This file contains 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
service: donkeyjob | |
provider: | |
name: aws | |
runtime: nodejs6.10 | |
functions: | |
getdonkeyjobs: | |
handler: handler.getdonkeyjobs | |
resources: | |
Resources: | |
donkeyjobs: | |
Type: AWS::DynamoDB::Table | |
Properties: | |
TableName: donkeyjobs | |
AttributeDefinitions: | |
- AttributeName: listingId | |
AttributeType: S | |
KeySchema: | |
- AttributeName: listingId | |
KeyType: HASH | |
ProvisionedThroughput: | |
ReadCapacityUnits: 1 | |
WriteCapacityUnits: 1 | |
# A policy is a resource that states one or more permssions. It lists actions, resources and effects. | |
DynamoDBIamPolicy: | |
Type: AWS::IAM::Policy | |
DependsOn: donkeyjobs | |
Properties: | |
PolicyName: lambda-dynamodb | |
PolicyDocument: | |
Version: '2012-10-17' | |
Statement: | |
- Effect: Allow | |
Action: | |
- dynamodb:DescribeTable | |
- dynamodb:Query | |
- dynamodb:Scan | |
- dynamodb:GetItem | |
- dynamodb:PutItem | |
- dynamodb:UpdateItem | |
- dynamodb:DeleteItem | |
Resource: arn:aws:dynamodb:*:*:table/donkeyjobs | |
Roles: | |
- Ref: IamRoleLambdaExecution |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment