- Added bootstrap destroy module structure for aws, ali, azure, gcp, and vultr. - Moved AWS force destroy script to `terraform-hcl-standard/aws-cloud/modules/bootstrap-destroy/destroy.sh`. - Updated `iac-pipeline-mutli-cloud-bootstrap..yaml` to dynamically invoke the destroy script based on the cloud provider. - Added placeholders for other cloud providers. |
||
|---|---|---|
| .. | ||
| bootstrap | ||
| config | ||
| envs/dev | ||
| modules | ||
| templates | ||
| README.md | ||
Azure Cloud Terraform Standard
该目录提供与 aws-cloud 模板一一对应的 Azure 版本,延续相同的目录与模块命名(bootstrap、config、modules、envs),便于将 AWS 使用习惯映射到 Azure。
模板映射(AWS → Azure)
- bootstrap/state → Storage Account:创建存储账户与容器用于 Terraform 远端状态。
- bootstrap/lock → Cosmos DB Table API:提供无服务器键值表存储。
- bootstrap/identity → RBAC 角色分配:为指定主体分配内置角色,替代 AWS IAM 角色/策略。
- modules:保留 AWS 模块命名,内部实现替换为 Azure 服务:
vpc:虚拟网络 + 子网(Virtual Network/Subnet)。alb:应用程序网关(Application Gateway)。nlb:标准负载均衡器(Standard Load Balancer)。ec2:Linux 虚拟机(Virtual Machine)。s3:存储账户与容器(Storage Account + Container)。rds:PostgreSQL 灵活服务器(Flexible Server)。redis:Azure Cache for Redis。sg:网络安全组与规则(Network Security Group)。iam:基于内置角色的角色分配(Role Assignment)。ami_lookup:公共镜像查找(Ubuntu 平台镜像)。landingzone:基础资源组与日志工作区。keypair:生成 SSH 密钥对。msk:事件中心命名空间与 Hub(Event Hubs)。
使用方式
- 在
templates/backend.tf中配置 Azure 存储作为 Terraform 远端状态(资源组、存储账户、容器)。 - 在
templates/provider.tf中设置subscription_id、tenant_id、location等参数。 - 参考
envs/dev/main.tf,按需修改变量后执行:terraform -chdir=envs/dev init terraform -chdir=envs/dev apply
本目录新增 Azure 代码,不改动现有 AWS 模板。