Created
December 9, 2020 01:56
-
-
Save awssimplified/f96437a5a3beed65bf4782eb7b69afa4 to your computer and use it in GitHub Desktop.
Revisions
-
awssimplified created this gist
Dec 9, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,53 @@ 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: "/"