Skip to content

Instantly share code, notes, and snippets.

@awssimplified
Created December 9, 2020 01:56
Show Gist options
  • Save awssimplified/f96437a5a3beed65bf4782eb7b69afa4 to your computer and use it in GitHub Desktop.
Save awssimplified/f96437a5a3beed65bf4782eb7b69afa4 to your computer and use it in GitHub Desktop.
AWSTemplateFormatVersion: 2010-09-09
Resources:
OrdersTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: AuthorsTable_prod
AttributeDefinitions:
- AttributeName: "AuthorName"
AttributeType: "S"
- AttributeName: "BookTitle"
AttributeType: "S"
KeySchema:
- AttributeName: "AuthorName"
KeyType: "HASH"
- AttributeName: "BookTitle"
KeyType: "RANGE"
TimeToLiveSpecification:
AttributeName: "ExpirationTime"
Enabled: true
ProvisionedThroughput:
ReadCapacityUnits: "10"
WriteCapacityUnits: "5"
DependsOn:
- DynamoDBQueryPolicy
DynamoDBQueryPolicy:
Type: "AWS::IAM::Policy"
Properties:
PolicyName: DynamoDBQueryPolicy
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
Action: "dynamodb:Query"
Resource: "*"
Roles:
- Ref: "OrdersTableQueryRole"
OrdersTableQueryRole:
Type: "AWS::IAM::Role"
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
Principal:
Service:
- "dynamodb.amazonaws.com"
Action:
- "sts:AssumeRole"
Path: "/"
@realiticsjs
Copy link

good

@EnriqueAguila
Copy link

thanks

@dncgr8
Copy link

dncgr8 commented Jan 29, 2023

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment