Created
April 25, 2016 20:38
-
-
Save ankona/8eb09a35d187e8cbc455799a8dd20c2e to your computer and use it in GitHub Desktop.
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", | |
"Metadata": { | |
}, | |
"Parameters": { | |
"EnvironmentParameter": { | |
"Type": "String", | |
"Default": "dev", | |
"AllowedValues": ["dev", "test", "stage", "lt", "prod"], | |
"Description": "Supply an environment from the choices: dev, test, stage, lt, or prod. The default is dev." | |
} | |
}, | |
"Resources": { | |
"SearchLogTable": { | |
"Type" : "AWS::DynamoDB::Table", | |
"Properties" : { | |
"AttributeDefinitions" : [ { "AttributeName": "search_id", "AttributeType": "S" }, | |
{ "AttributeName": "user_id", "AttributeType": "S" }, | |
{ "AttributeName": "timestamp", "AttributeType": "N" } ], | |
"KeySchema" : [ { "AttributeName": "search_id", "KeyType": "HASH" } ], | |
"ProvisionedThroughput" : { | |
"ReadCapacityUnits" : "3", | |
"WriteCapacityUnits" : "3" | |
}, | |
"GlobalSecondaryIndexes": [{ | |
"IndexName" : "user_id-timestamp-index", | |
"KeySchema" : [ { "AttributeName": "user_id", "KeyType": "HASH" }, | |
{ "AttributeName": "timestamp", "KeyType": "RANGE" } ], | |
"Projection" : { "ProjectionType": "ALL" }, | |
"ProvisionedThroughput" : { "ReadCapacityUnits" : "1", "WriteCapacityUnits" : "3" } | |
}], | |
"TableName": { "Fn::Join": ["", ["search_log_", | |
{ "Ref": "EnvironmentParameter" }]] } | |
} | |
}, | |
"JobTrackerTable": { | |
"Type" : "AWS::DynamoDB::Table", | |
"Properties" : { | |
"AttributeDefinitions" : [ { "AttributeName": "tracker_id", "AttributeType": "S" }, | |
{ "AttributeName": "user_id", "AttributeType": "S" }, | |
{ "AttributeName": "status", "AttributeType": "S" }, | |
{ "AttributeName": "timestamp", "AttributeType": "N" }, | |
{ "AttributeName": "client_id", "AttributeType": "S" }, | |
{ "AttributeName": "job_id", "AttributeType": "S" }], | |
"KeySchema" : [ { "AttributeName": "tracker_id", "KeyType": "HASH" } ], | |
"ProvisionedThroughput" : { | |
"ReadCapacityUnits" : "3", | |
"WriteCapacityUnits" : "3" | |
}, | |
"GlobalSecondaryIndexes": [ | |
{ "IndexName" : "user_id-status-index", | |
"KeySchema" : [ { "AttributeName": "user_id", "KeyType": "HASH" }, | |
{ "AttributeName": "status", "KeyType": "RANGE" } ], | |
"Projection" : { "ProjectionType": "ALL" }, | |
"ProvisionedThroughput" : { "ReadCapacityUnits" : "2", "WriteCapacityUnits" : "1" } | |
},{ | |
"IndexName" : "user_id-timestamp-index", | |
"KeySchema" : [ { "AttributeName": "user_id", "KeyType": "HASH" }, | |
{ "AttributeName": "timestamp", "KeyType": "RANGE" } ], | |
"Projection" : { "ProjectionType": "ALL" }, | |
"ProvisionedThroughput" : { "ReadCapacityUnits" : "2", "WriteCapacityUnits" : "1" } | |
} | |
], | |
"TableName": { "Fn::Join": ["", ["interest_tracker_", | |
{ "Ref": "EnvironmentParameter" }]] } | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
aws --profile <insert_profile_name> cloudformation create-stack --stack-name cmtest-params-stage --template-body file:///path/to/dynamo-cf-sample.json --parameters ParameterKey=EnvironmentParameter,ParameterValue=stage