This is part of my CloudFormation template:
resources:
DynamoDBTablePoints:
Type: 'AWS::DynamoDB::Table'
Properties:
TableName: points
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: '5'
WriteCapacityUnits: '5'
DynamoDBTableScore:
Type: 'AWS::DynamoDB::Table'
Properties:
TableName: score
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: '5'
WriteCapacityUnits: '5'
DynamoDBTableName:
Type: 'AWS::DynamoDB::Table'
Properties:
TableName: name
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: '5'
WriteCapacityUnits: '5'
It creates a 3 DynamoDB resources. This is just an example, do not concentrate on the names or if the tables created are correct. I want to know how to apply this tactic to any resource.
As you can see, there are 3 pretty much the same resource they just differ in name. How can I have one entry like this:
resources:
DynamoDBTable[Point, Score, Name]:
Type: 'AWS::DynamoDB::Table'
Properties:
TableName: [point, score, name]
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: '5'
WriteCapacityUnits: '5'
'''
So I get the same result as with the original template.