Skip to content

Instantly share code, notes, and snippets.

@husobee
Created February 3, 2025 13:16
Show Gist options
  • Save husobee/57ba1f1abccca569cfd12fb895c11814 to your computer and use it in GitHub Desktop.
Save husobee/57ba1f1abccca569cfd12fb895c11814 to your computer and use it in GitHub Desktop.
example
AWSTemplateFormatVersion: "2010-09-09"
Description: "CloudFormation Stack with S3 and DynamoDB"
Resources:
MyS3Bucket:
Type: "AWS::S3::Bucket"
Properties:
BucketName: !Sub "my-app-bucket-${AWS::AccountId}"
MyDynamoDBTable:
Type: "AWS::DynamoDB::Table"
Properties:
TableName: "MyAppTable"
AttributeDefinitions:
- AttributeName: "ID"
AttributeType: "S"
KeySchema:
- AttributeName: "ID"
KeyType: "HASH"
BillingMode: "PAY_PER_REQUEST"
DeletionPolicy: Retain # Ensures table isn't deleted if removed from stack
AWSTemplateFormatVersion: "2010-09-09"
Description: "Updated Stack - S3 and DynamoDB Removed"
Resources:
# MyS3Bucket and MyDynamoDBTable are removed from the stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment