Skip to content

Instantly share code, notes, and snippets.

@exinmusic
Created July 23, 2022 20:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exinmusic/0c0f956534c6e93675beb64916f2bd86 to your computer and use it in GitHub Desktop.
Save exinmusic/0c0f956534c6e93675beb64916f2bd86 to your computer and use it in GitHub Desktop.
AWSTemplateFormatVersion: '2010-09-09'
Description: Template to create terraform s3 bucket and ddb lock table
Parameters:
TFStateBucketName:
Description: 'Terraform State Bucket Name'
Type: String
Default: tf-state
TFStateLockTableName:
Description: 'Terraform DDB Lock Table Name'
Type: String
Default: tf-lock
Resources:
S3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref TFStateBucketName
VersioningConfiguration:
Status: Enabled
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: 'AES256'
DynamoDBTable:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
-
AttributeName: "LockID"
AttributeType: "S"
BillingMode: PAY_PER_REQUEST
KeySchema:
-
AttributeName: "LockID"
KeyType: "HASH"
TableName: !Ref TFStateLockTableName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment