[![GitHub](https://img.shields.io/github/license/pepperize/cdk-terraform-state-backend?style=flat-square)](https://github.com/pepperize/cdk-terraform-state-backend/blob/main/LICENSE)
[![npm (scoped)](https://img.shields.io/npm/v/@pepperize/cdk-terraform-state-backend?style=flat-square)](https://www.npmjs.com/package/@pepperize/cdk-terraform-state-backend)
[![PyPI](https://img.shields.io/pypi/v/pepperize.cdk-terraform-state-backend?style=flat-square)](https://pypi.org/project/pepperize.cdk-terraform-state-backend/)
[![Nuget](https://img.shields.io/nuget/v/Pepperize.CDK.TerraformStateBackend?style=flat-square)](https://www.nuget.org/packages/Pepperize.CDK.TerraformStateBackend/)
[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/pepperize/cdk-terraform-state-backend/release/main?label=release&style=flat-square)](https://github.com/pepperize/cdk-terraform-state-backend/actions/workflows/release.yml)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/pepperize/cdk-terraform-state-backend?sort=semver&style=flat-square)](https://github.com/pepperize/cdk-terraform-state-backend/releases)
# 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](https://www.terraform.io/docs/language/settings/backends/s3.html).
Terraform doesn't come shipped with a cli command bootstrapping the account for [State Storage and Locking](https://www.terraform.io/docs/language/state/backends.html)
like [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/cli.html#cli-bootstrap) 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
See [API.md](https://github.com/pepperize/cdk-terraform-state-backend/blob/main/API.md)
## Install
### TypeScript
```shell
npm install @pepperize/cdk-terraform-state-backend
```
or
```shell
yarn add @pepperize/cdk-terraform-state-backend
```
### Python
```shell
pip install pepperize.cdk-terraform-state-backend
```
### C# / .Net
```
dotnet add package Pepperize.CDK.TerraformStateBackend
```
## Example
```python
import { App, Stack } from "@aws-cdk/core";
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",
});
```
```hcl
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](https://www.terraform.io/docs/language/settings/backends/s3.html#example-configuration)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共16个文件
txt:4个
py:3个
pkg-info:2个
资源分类:Python库 所属语言:Python 资源全名:pepperize.cdk-terraform-state-backend-0.0.48.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
pepperize.cdk-terraform-state-backend-0.0.48.tar.gz (16个子文件)
pepperize.cdk-terraform-state-backend-0.0.48
MANIFEST.in 23B
PKG-INFO 4KB
pyproject.toml 106B
LICENSE 1KB
src
pepperize.cdk_terraform_state_backend.egg-info
PKG-INFO 4KB
requires.txt 194B
SOURCES.txt 634B
top_level.txt 38B
dependency_links.txt 1B
pepperize_cdk_terraform_state_backend
py.typed 1B
_jsii
cdk-terraform-state-backend@0.0.48.jsii.tgz 9KB
__init__.py 509B
__init__.py 6KB
setup.cfg 38B
setup.py 2KB
README.md 3KB
共 16 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 12w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功