Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BackSpace Academy Certified Developer Associate CloudFormation LAB
{
"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