Registry / aws / pepperize-cdk-terraform-state-backend

pepperize-cdk-terraform-state-backend

JSON →
library0.1.1205pypypi✓ verified 83d ago

Provides an AWS CDK construct to bootstrap an AWS account with an S3 bucket and DynamoDB table for use as a Terraform state backend. Version 0.1.1205, frequent releases.

pip install pepperize-cdk-terraform-state-backend
INSTALL
IMPORT
SIG · PEPPERIZE-CDK-TERR
P
pepperize-cdk-terraform-state-backend
awspythonv0.1.1205
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TerraformStateBackend
from pepperize_cdk_terraform_state_backend import TerraformStateBackend
from pepperize_cdk_terraform_state_backend.terraform_state_backend import TerraformStateBackend
Incorrect import path; the correct module is the package __init__.

Deploys an S3 bucket and DynamoDB table for Terraform state.

from constructs import Construct from aws_cdk import App, Stack from pepperize_cdk_terraform_state_backend import TerraformStateBackend class MyStack(Stack): def __init__(self, scope: Construct, id: str, **kwargs): super().__init__(scope, id, **kwargs) TerraformStateBackend(self, "Backend", bucket_name="my-terraform-state", table_name="my-terraform-lock" ) app = App() MyStack(app, "MyStack") app.synth()
Debug
Known issues
gotchaThe construct creates resources with default removal policy (DESTROY) unless overridden. Be cautious with production state.
fix
Set removal_policy on the construct props to RETAIN.
affects: *
gotchaBucket name and table name must be globally unique across all AWS accounts. Duplicating names leads to deployment errors.
fix
Use unique identifiers or suffix with account ID/region.
affects: *
breakingVersion 0.1.0 changed the import path; older versions used a different module structure.
fix
Use 'from pepperize_cdk_terraform_state_backend import TerraformStateBackend'.
affects: <0.1.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pepperize_cdk_terraform_state_backend'
Package not installed or wrong Python environment.
fix
Run 'pip install pepperize-cdk-terraform-state-backend' in the correct environment.
jsii.errors.JSIIError: ...
Incompatible CDK version (requires aws-cdk-lib >=2).
fix
Upgrade aws-cdk-lib to version 2.x or later.
Resource handler returned message: "Bucket with the same name already exists"
S3 bucket name conflict (global namespace).
fix
Change bucket_name to a unique string, e.g., '{}-{}'.format(account_id, bucket_name).
Upgrade
Version history
0.1.1205latest on PyPI · released Jun 17, 2025
Audit
Dependencies
aws-cdk-librequiredRequired constructs and core CDK classes.
constructsrequiredBase construct class.
Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
pepperize-cdk-terraform-state-backend — pip install pepperize-cdk-terraform-state-backend · libregistry