This project provides a CDK construct bootstrapping an AWS account with a S3 Bucket and a DynamoDB table as terraform state backend.
Project description
AWS CDK Terraform state backend
This project provides a CDK construct bootstrapping an AWS account with a S3 Bucket and a DynamoDB table as Terraform state backend.
Terraform doesn't come shipped with a cli command bootstrapping the account for State Storage and Locking
like AWS CDK provides with cdk bootstrap
.
While bootstrapping the AWS Organization and Accounts this construct may be used to create:
- S3 Bucket with blocked public access, versioned, encrypted by SSE-KMS
- DynamoDB Table with pay per request, continuous backups using point-in-time recovery, encrypted by AWS owned key
Example
# Example automatically generated from non-compiling source. May contain errors.
from aws_cdk.core import Environment
from aws_cdk.core import App, Stack
from pepperize.cdk_terraform_state_backend import TerraformStateBackend
app = App()
stack = Stack(app, "stack",
env=Environment(
account="123456789012",
region="us-east-1"
)
)
# When
TerraformStateBackend(stack, "TerraformStateBackend",
bucket_name="terraform-state-backend",
table_name="terraform-state-backend"
)
terraform {
backend "s3" {
bucket = "terraform-state-backend-123456789012-us-east-1"
dynamodb_table = "terraform-state-backend-123456789012"
key = "path/to/my/key"
region = "us-east-1"
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pepperize.cdk-terraform-state-backend-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04b58a5e33975e6a6854aa0d240e6b15f08e410b8003c36d30fe12cda5c239a1 |
|
MD5 | fb251293c5f1d7e6c1d40750d73f5173 |
|
BLAKE2b-256 | 9397ab398cf3be92c708eacaf3e0d452f14f1160760b6c824ae2b11c1a0578cf |
Close
Hashes for pepperize.cdk_terraform_state_backend-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c4eeb44b38367ce61f6d7be56a6655422c1830ce688b076ca3d5093a4085d55 |
|
MD5 | 47504db730fd356e9e9ab3a3382ee525 |
|
BLAKE2b-256 | 0fb4d3f608cbc3f5e536293219808633a7931ee12525ae6c59eafea0fd664c6b |