Skills covered: 3.3.4, 3.4.3
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
Environment:
Type: String
AllowedValues: [dev, staging, prod]
Mappings:
EnvConfig:
dev:
InstanceType: t3.micro
prod:
InstanceType: t3.small
Resources:
MyTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: !Sub '${Environment}-orders'
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: orderId
AttributeType: S
KeySchema:
- AttributeName: orderId
KeyType: HASH
Outputs:
TableArn:
Value: !GetAtt MyTable.Arn
Export:
Name: !Sub '${Environment}-OrderTableArn'