-
-
Save bs25255/ebce81f735fcbd3f115255fa4dfabe59 to your computer and use it in GitHub Desktop.
BackSpace Academy Certified Developer Associate CloudFormation LAB
This file contains 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 characters
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "DynamoDB Lab Products Database", | |
"Parameters": { | |
"ReadCapacityUnits": { | |
"Description": "Provisioned read throughput", | |
"Type": "Number", | |
"Default": "1", | |
"MinValue": "1", | |
"MaxValue": "10000", | |
"ConstraintDescription": "must be between 1 and 10000" | |
}, | |
"WriteCapacityUnits": { | |
"Description": "Provisioned write throughput", | |
"Type": "Number", | |
"Default": "1", | |
"MinValue": "1", | |
"MaxValue": "10000", | |
"ConstraintDescription": "must be between 1 and 10000" | |
} | |
}, | |
"Resources": { | |
"TableOfProducts": { | |
"Type": "AWS::DynamoDB::Table", | |
"Properties": { | |
"AttributeDefinitions": [ | |
{ | |
"AttributeName": "Id", | |
"AttributeType": "N" | |
}, | |
{ | |
"AttributeName": "ProductCategory", | |
"AttributeType": "S" | |
}, | |
{ | |
"AttributeName": "Price", | |
"AttributeType": "N" | |
} | |
], | |
"KeySchema": [ | |
{ | |
"AttributeName": "Id", | |
"KeyType": "HASH" | |
} | |
], | |
"ProvisionedThroughput": { | |
"ReadCapacityUnits": { | |
"Ref": "ReadCapacityUnits" | |
}, | |
"WriteCapacityUnits": { | |
"Ref": "WriteCapacityUnits" | |
} | |
}, | |
"GlobalSecondaryIndexes": [ | |
{ | |
"IndexName": "ProductCategory-Price-index", | |
"KeySchema": [ | |
{ | |
"AttributeName": "ProductCategory", | |
"KeyType": "HASH" | |
}, | |
{ | |
"AttributeName": "Price", | |
"KeyType": "RANGE" | |
} | |
], | |
"Projection": { | |
"ProjectionType": "ALL" | |
}, | |
"ProvisionedThroughput": { | |
"ReadCapacityUnits": { | |
"Ref": "ReadCapacityUnits" | |
}, | |
"WriteCapacityUnits": { | |
"Ref": "WriteCapacityUnits" | |
} | |
} | |
} | |
] | |
} | |
} | |
}, | |
"Outputs": { | |
"TableName": { | |
"Value": { | |
"Ref": "TableOfProducts" | |
}, | |
"Description": "Test CloudFormation template for the BackSpace Lab" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment