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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49b8a26ec599ba24241b50394ceafc85e37e74970270b0e2e8c5b716dc3d5251 |
|
MD5 | c3ab290dc3f11554b6c7f68e8c85e7ed |
|
BLAKE2b-256 | bce5abdb19e50ee8d551e2213ea3516601577468730f8e495534d8f7e3b55dec |
Close
Hashes for pepperize.cdk_terraform_state_backend-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70c141addfa6ed6e8bfbfdd5161e1711bcd0f4153a94b0d62674e29abf43574b |
|
MD5 | f913fa30fc1fff3f18260745c013118e |
|
BLAKE2b-256 | 3a86d5eea727e58381ad1af8540419624d61aa3317840f3fde532c5999ff3d76 |