Skip to content

Instantly share code, notes, and snippets.

@pcoady
Created August 28, 2015 10:41
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save pcoady/efa71c94cfbba3c0469b to your computer and use it in GitHub Desktop.
Save pcoady/efa71c94cfbba3c0469b to your computer and use it in GitHub Desktop.
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