Skip to main content

PRs Welcome GitHub npm (scoped) PyPI Nuget Sonatype Nexus (Releases) GitHub Workflow Status (branch) GitHub release (latest SemVer)

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-S3
  • DynamoDB Table with pay per request, continuous backups using point-in-time recovery, encrypted by AWS owned key
  • IAM Policy with read/write access to the created S3 Bucket and DynamoDB Table

See API.md

Install

TypeScript

npm install @pepperize/cdk-terraform-state-backend

or

yarn add @pepperize/cdk-terraform-state-backend

Python

pip install pepperize.cdk-terraform-state-backend

C# / .Net

dotnet add package Pepperize.CDK.TerraformStateBackend

Java

<dependency>
  <groupId>com.pepperize</groupId>
  <artifactId>cdk-terraform-state-backend</artifactId>
  <version>${cdkTerraformStateBackend.version}</version>
</dependency>

Example

import { App, Stack } from "aws-cdk-lib";
import { TerraformStateBackend } from "@pepperize/cdk-terraform-state-backend";

const app = new App();
const stack = new Stack(app, "stack", {
  env: {
    account: "123456789012",
    region: "us-east-1",
  },
});

// When
new TerraformStateBackend(stack, "TerraformStateBackend", {
  bucketName: "terraform-state-backend",
  tableName: "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"
  }
}

See Terraform S3 Example Configuration

Metadata

Release files for pepperize.cdk-terraform-state-backend 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pepperize.cdk-terraform-state-backend 0.2.0
File Size Uploaded Provenance Actions
pepperize_cdk_terraform_state_backend-0.2.0.tar.gz 34.5 kB Without provenance Details for pepperize_cdk_terraform_state_backend-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pepperize.cdk-terraform-state-backend 0.2.0
File Interpreter ABI Platform Actions
pepperize_cdk_terraform_state_backend-0.2.0-py3-none-any.whl Python 3 none any Details for pepperize_cdk_terraform_state_backend-0.2.0-py3-none-any.whl

Total release size: 69.8 kB

Release files / pepperize_cdk_terraform_state_backend-0.2.0.tar.gz

Download URL pepperize_cdk_terraform_state_backend-0.2.0.tar.gz
Size 34.5 kB
Tags Source
SHA-256 checksum
How to use checksums
98bff0e04aec786f709608a625d3726511a6d5b3618a31a2dc21a51b0ef777cf
BLAKE2b-256 checksum
How to use checksums
b51cd3bdc51508698b52490f034483a48356cc0d7ceb1fd8c11babb1dcbb41a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.15.2

Release files / pepperize_cdk_terraform_state_backend-0.2.0-py3-none-any.whl

Download URL pepperize_cdk_terraform_state_backend-0.2.0-py3-none-any.whl
Size 35.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c5ab01b851ffc8a504d35655ccf119074376d58fdecb669683d8a81a4852d12
BLAKE2b-256 checksum
How to use checksums
9ae229580ff0a2f0a4ec1675e2f585ec89d2be45a933828448f70f8f0ecc4c21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.15.2

Security for pepperize.cdk-terraform-state-backend 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page