Registry /
aws / pepperize-cdk-terraform-state-backend
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()
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pepperize_cdk_terraform_state_backend'
Package not installed or wrong Python environment.
fixRun 'pip install pepperize-cdk-terraform-state-backend' in the correct environment.
jsii.errors.JSIIError: ...
Incompatible CDK version (requires aws-cdk-lib >=2).
fixUpgrade 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).
fixChange 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.