Initial commit: Terraform configurations for multiple cloud providers

This commit is contained in:
Ben User
2026-02-01 06:36:02 +00:00
commit 70f160b396
58 changed files with 1813 additions and 0 deletions

15
volcengine/personal/.gitignore vendored Normal file
View File

@@ -0,0 +1,15 @@
# Terraform files
*.tfstate
*.tfstate.*
.terraform/
.terraform.lock.hcl
# Sensitive files
terraform.tfvars
# Local temporary files
*.tmp
*.backup
# Terragrunt
.terragrunt-cache/

View File

@@ -0,0 +1,9 @@
provider_installation {
filesystem_mirror {
path = "/home/ben/terraform"
include = ["volcengine/*"]
}
direct {
exclude = ["volcengine/*"]
}
}

View File

@@ -0,0 +1,5 @@
# 火山引擎个人账号配置
[personal]
access_key_id = AKLTYWQwMjgyNWM1ZmIzNDk3MTljYzNmNTgyMjQ2NzU2ZGY
secret_access_key = T0RGak9UY3dZV05qT1RCbU5HVXpabUkwTXpSaVpEQmlNbVF3WWpObU0yTQ==
region = cn-beijing

View File

@@ -0,0 +1,32 @@
# 火山引擎 Terraform 配置 - 个人账号
terraform {
required_providers {
volcengine = {
source = "volcengine/volcengine"
version = "0.0.186" # 使用最新可用版本
}
}
}
# 示例资源 - VPC
resource "volcengine_vpc" "personal_vpc" {
vpc_name = var.vpc_name
cidr_block = var.cidr_block
}
# 输出信息
output "vpc_id" {
description = "Personal VPC ID"
value = volcengine_vpc.personal_vpc.id
}
output "vpc_name" {
description = "Personal VPC Name"
value = volcengine_vpc.personal_vpc.vpc_name
}
output "region" {
description = "Region"
value = var.region
}

View File

@@ -0,0 +1,6 @@
# 配置本地 provider
provider "volcengine" {
region = var.region
access_key = var.access_key_id
secret_key = var.secret_access_key
}

View File

@@ -0,0 +1,30 @@
# 火山引擎 Terraform 变量定义
variable "region" {
description = "目标区域"
type = string
default = "cn-beijing"
}
variable "access_key_id" {
description = "访问密钥ID"
type = string
}
variable "secret_access_key" {
description = "秘密访问密钥"
type = string
sensitive = true
}
variable "vpc_name" {
description = "VPC名称"
type = string
default = "terraform-vpc"
}
variable "cidr_block" {
description = "VPC CIDR块"
type = string
default = "172.16.0.0/16"
}