Skip to content

Instantly share code, notes, and snippets.

@johnshumon
Created September 21, 2024 08:29
Show Gist options
  • Save johnshumon/85a7db1b6919ab1e84c24fe20f070b59 to your computer and use it in GitHub Desktop.
Save johnshumon/85a7db1b6919ab1e84c24fe20f070b59 to your computer and use it in GitHub Desktop.
Example template provides a structured configuration to import existing AWS DynamoDB resources into a CloudFormation stack.
{
"Resources": {
"tableA2982BC25": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"AttributeDefinitions": [
{
"AttributeName": "userId",
"AttributeType": "S"
},
{
"AttributeName": "userName",
"AttributeType": "S"
}
],
"BillingMode": "PAY_PER_REQUEST",
"KeySchema": [
{
"AttributeName": "userId",
"KeyType": "HASH"
},
{
"AttributeName": "userName",
"KeyType": "RANGE"
}
],
"PointInTimeRecoverySpecification": {
"PointInTimeRecoveryEnabled": true
},
"TableName": "table-a"
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"tableB0591584A": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"AttributeDefinitions": [
{
"AttributeName": "userId",
"AttributeType": "S"
},
{
"AttributeName": "postId",
"AttributeType": "S"
}
],
"BillingMode": "PAY_PER_REQUEST",
"KeySchema": [
{
"AttributeName": "userId",
"KeyType": "HASH"
},
{
"AttributeName": "postbId",
"KeyType": "RANGE"
}
],
"PointInTimeRecoverySpecification": {
"PointInTimeRecoveryEnabled": true
},
"TableName": "table-b"
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"tableC1A858E80": {
"Type": "AWS::DynamoDB::Table",
"Properties": {
"AttributeDefinitions": [
{
"AttributeName": "userId",
"AttributeType": "S"
},
{
"AttributeName": "itemyId",
"AttributeType": "S"
}
],
"BillingMode": "PAY_PER_REQUEST",
"KeySchema": [
{
"AttributeName": "userId",
"KeyType": "HASH"
},
{
"AttributeName": "itemId",
"KeyType": "RANGE"
}
],
"PointInTimeRecoverySpecification": {
"PointInTimeRecoveryEnabled": true
},
"TableName": "table-c"
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment