Initial commit: Terraform configurations for multiple cloud providers
This commit is contained in:
41
README.md
Normal file
41
README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# 多云 Terraform 项目
|
||||
|
||||
这是一个用于管理多个云平台基础设施的 Terraform 项目。
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
.
|
||||
├── volcengine/ # 火山引擎(字节跳动)配置
|
||||
├── oracle/ # Oracle Cloud(甲骨文云)配置
|
||||
├── aws/ # Amazon Web Services 配置
|
||||
└── modules/ # 共享模块
|
||||
```
|
||||
|
||||
## 使用方法
|
||||
|
||||
### 1. 初始化特定云平台
|
||||
```bash
|
||||
cd volcengine
|
||||
terraform init
|
||||
```
|
||||
|
||||
### 2. 配置访问凭证
|
||||
在每个云的 `main.tf` 文件中配置相应的访问凭证:
|
||||
|
||||
- **火山引擎**:需要 `access_key`、`secret_key` 和 `region`
|
||||
- **Oracle Cloud**:需要 `tenancy_ocid`、`user_ocid`、`fingerprint`、`private_key_path` 和 `region`
|
||||
- **AWS**:需要 `access_key`、`secret_key` 和 `region`
|
||||
|
||||
### 3. 规划和应用
|
||||
```bash
|
||||
terraform plan
|
||||
terraform apply
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. 每个云目录独立管理其 Terraform 状态
|
||||
2. 共享模块放在 `modules/` 目录中
|
||||
3. 敏感信息应使用环境变量或 Terraform 变量文件管理
|
||||
4. 建议使用 `.gitignore` 排除 `.terraform` 目录和状态文件
|
||||
Reference in New Issue
Block a user