Initial commit: Terraform configurations for multiple cloud providers
This commit is contained in:
14
oracle/modules/compute/main.tf
Normal file
14
oracle/modules/compute/main.tf
Normal file
@@ -0,0 +1,14 @@
|
||||
# Oracle 计算实例模块示例
|
||||
# 这是一个示例,实际使用时需要替换为真实的 OCI 资源
|
||||
|
||||
resource "null_resource" "compute_example" {
|
||||
triggers = {
|
||||
compartment_id = var.compartment_id
|
||||
instance_name = var.instance_name
|
||||
shape = var.shape
|
||||
}
|
||||
|
||||
provisioner "local-exec" {
|
||||
command = "echo '创建计算实例: ${var.instance_name},规格: ${var.shape},在 Compartment: ${var.compartment_id}'"
|
||||
}
|
||||
}
|
||||
21
oracle/modules/compute/variables.tf
Normal file
21
oracle/modules/compute/variables.tf
Normal file
@@ -0,0 +1,21 @@
|
||||
variable "compartment_id" {
|
||||
description = "Compartment OCID"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "instance_name" {
|
||||
description = "计算实例名称"
|
||||
type = string
|
||||
default = "my-instance"
|
||||
}
|
||||
|
||||
variable "shape" {
|
||||
description = "实例规格"
|
||||
type = string
|
||||
default = "VM.Standard2.1"
|
||||
}
|
||||
|
||||
variable "subnet_id" {
|
||||
description = "子网 OCID"
|
||||
type = string
|
||||
}
|
||||
Reference in New Issue
Block a user