towardsthecloud/aws-cloudformation-starter-kit
GitHub: towardsthecloud/aws-cloudformation-starter-kit
这是一个生产级 AWS CloudFormation 起步套件,集成了 OIDC 认证、自动化 CI/CD 及安全扫描,用于简化基础设施即代码的部署与管理。
Stars: 27 | Forks: 3
# [](https://towardsthecloud.com)
# AWS CloudFormation Starter Kit
欢迎使用 AWS CloudFormation Starter Kit,旨在通过 CloudFormation 模板和 Rain 工具简化您的基础设施设置。此仓库提供了一种结构化的方法来将您的 AWS 资源作为代码进行管理,确保高效且可靠的部署。
## 🚀 功能
- ⚡ **一键设置**:单个引导脚本自动设置您的基础设施流水线
- 生成特定于环境的参数文件
- 配置 OIDC 提供商以实现安全的无密钥身份验证
- 自动生成用于 CI/CD 的 GitHub Actions 工作流
- 🔒 **安全部署**:通过经 OIDC 身份验证的 GitHub Actions 部署堆栈——无需长期 IAM 凭证
- 🤖 **Pre-Commit 验证**:cfn-lint 和 Checkov 在部署前捕获问题
- 🌐 **多环境支持**:为 dev、staging 和 production 提供独立的参数文件,并配有隔离的工作流
## 快速开始
本项目需要 **Python 3** 和 **pip** 来管理依赖项。
**要开始使用,请按照以下步骤操作:**
1. 点击绿色的 ["Use this template"](https://github.com/new?template_name=aws-cloudformation-starter-kit&template_owner=towardsthecloud) 按钮以基于此入门套件创建一个新仓库。
2. 通过 pip 安装 checkov、cfn-lint,并通过 homebrew 安装 rain:
```
brew install rain
pip install -r requirements.txt
```
3. 运行 `provision-repo.sh` 脚本以生成您环境的参数和工作流文件:
```
./scripts/provision-repo.sh
```
4. 验证您的 CloudFormation 模板:
```
./scripts/validate.sh
```
5. 部署 oidc-provider CloudFormation 堆栈:
```
./scripts/deploy-templates.sh
```
6. 在 GitHub 上导航到您的仓库设置,并按如下所示配置 Actions 变量:

现在,您可以通过将更改提交到 main 分支来部署您的 CloudFormation 堆栈。
## 完整文档
有关此入门套件的工作原理、高级配置选项和最佳实践的完整详细信息,请访问官方文档:
**[查看完整文档 →](https://towardsthecloud.com/docs/aws-cloudformation-starter-kit)**
## AWS CDK Starter Kit
## 致谢
特别感谢 [Rain](https://github.com/aws-cloudformation/rain)、[Checkov](https://github.com/bridgecrewio/checkov) 和 [cfn-lint](https://github.com/aws-cloudformation/cfn-lint) 的创作者,感谢他们提供了让基础设施管理更轻松、更安全的宝贵工具。
## 作者
[Danny Steenman](https://towardsthecloud.com/about)
[](https://www.linkedin.com/company/towardsthecloud)
[](https://twitter.com/dannysteenman)
[](https://github.com/towardsthecloud)
标签:AWS, cfn-lint, CloudFormation, DPI, GitHub Actions, IaC安全, OIDC认证, Python, Rain工具, Shell脚本, 启动模板, 多环境管理, 安全扫描, 无后门, 无密钥认证, 时序注入, 特权提升, 系统运维, 自动化部署, 自动笔记, 逆向工具