Skip to content

Instantly share code, notes, and snippets.

@benjamincrozat
Last active June 23, 2020 09:34
Show Gist options
  • Save benjamincrozat/a0aad88fd5f711e06f41ba7b03fb115a to your computer and use it in GitHub Desktop.
Save benjamincrozat/a0aad88fd5f711e06f41ba7b03fb115a to your computer and use it in GitHub Desktop.
provider:
iamRoleStatements:
- Effect: Allow
Action: [dynamodb:Query, dynamodb:Scan, dynamodb:GetItem, dynamodb:PutItem, dynamodb:UpdateItem, dynamodb:DeleteItem]
Resource:
Fn::GetAtt: [ChirpCache, Arn]
- Effect: Allow
Action: [sqs:SendMessage, sqs:DeleteMessage]
Resource:
Fn::GetAtt: [ TwitterQueue, Arn ]
resources:
Resources:
ChirpCache:
Type: AWS::DynamoDB::Table
Properties:
TableName: chirp_cache
AttributeDefinitions:
- AttributeName: key
AttributeType: S
KeySchema:
- AttributeName: key
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
TwitterQueue:
Type: AWS::SQS::Queue
Properties:
RedrivePolicy:
maxReceiveCount: 3
deadLetterTargetArn:
Fn::GetAtt: [ DeadLetterQueue, Arn ]
DeadLetterQueue:
Type: AWS::SQS::Queue
Properties:
MessageRetentionPeriod: 1209600 # 14 days.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment