Initial commit: Terraform configurations for multiple cloud providers
This commit is contained in:
13
oracle/modules/vcn/main.tf
Normal file
13
oracle/modules/vcn/main.tf
Normal file
@@ -0,0 +1,13 @@
|
||||
# Oracle VCN 模块示例
|
||||
# 这是一个示例,实际使用时需要替换为真实的 OCI 资源
|
||||
|
||||
resource "null_resource" "vcn_example" {
|
||||
triggers = {
|
||||
compartment_id = var.compartment_id
|
||||
vcn_name = var.vcn_name
|
||||
}
|
||||
|
||||
provisioner "local-exec" {
|
||||
command = "echo '创建 VCN: ${var.vcn_name},CIDR: ${var.cidr_block},在 Compartment: ${var.compartment_id}'"
|
||||
}
|
||||
}
|
||||
9
oracle/modules/vcn/outputs.tf
Normal file
9
oracle/modules/vcn/outputs.tf
Normal file
@@ -0,0 +1,9 @@
|
||||
output "vcn_name" {
|
||||
description = "VCN 名称"
|
||||
value = var.vcn_name
|
||||
}
|
||||
|
||||
output "cidr_block" {
|
||||
description = "CIDR 地址块"
|
||||
value = var.cidr_block
|
||||
}
|
||||
22
oracle/modules/vcn/variables.tf
Normal file
22
oracle/modules/vcn/variables.tf
Normal file
@@ -0,0 +1,22 @@
|
||||
variable "compartment_id" {
|
||||
description = "Compartment OCID where the VCN will be created"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "vcn_name" {
|
||||
description = "Name of the VCN"
|
||||
type = string
|
||||
default = "my-vcn"
|
||||
}
|
||||
|
||||
variable "cidr_block" {
|
||||
description = "CIDR block for the VCN"
|
||||
type = string
|
||||
default = "10.0.0.0/16"
|
||||
}
|
||||
|
||||
variable "dns_label" {
|
||||
description = "DNS label for the VCN"
|
||||
type = string
|
||||
default = "vcn"
|
||||
}
|
||||
Reference in New Issue
Block a user