Parameters: App: Type: String Description: Your application's name. Env: Type: String Description: The name of the environment being deployed. Resources: {{logicalIDSafe .Name}}: Metadata: 'aws:copilot:description': 'An Amazon DynamoDB table for {{.Name}}' Type: AWS::DynamoDB::Table Properties: TableName: !Sub ${App}-${Env}-{{.Name}} AttributeDefinitions:{{range .Attributes}} - AttributeName: {{.Name}} AttributeType: "{{.DataType}}"{{end}} BillingMode: PAY_PER_REQUEST KeySchema: - AttributeName: {{.PartitionKey}} KeyType: HASH{{ if .SortKey }} - AttributeName: {{.SortKey}} KeyType: RANGE{{end}}{{if .HasLSI}} LocalSecondaryIndexes:{{range .LSIs}} - IndexName: {{.Name}} KeySchema: - AttributeName: {{.PartitionKey}} KeyType: HASH - AttributeName: {{.SortKey}} KeyType: RANGE Projection: ProjectionType: ALL{{end}}{{end}} Outputs: {{envVarName .Name}}: Description: "The name of this DynamoDB table." Value: !Ref {{logicalIDSafe .Name}} Export: Name: !Sub ${App}-${Env}-{{logicalIDSafe .Name}}TableName {{logicalIDSafe .Name}}DynamoDBTableARN: Description: "The ARN of the {{.Name}} DynamoDB table." Value: !GetAtt {{logicalIDSafe .Name}}.Arn Export: Name: !Sub ${App}-${Env}-{{logicalIDSafe .Name}}TableArn