Initial commit: Terraform configurations for multiple cloud providers
This commit is contained in:
38
oracle/environments/dev/main.tf
Normal file
38
oracle/environments/dev/main.tf
Normal file
@@ -0,0 +1,38 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
oci = {
|
||||
source = "oracle/oci"
|
||||
version = ">= 4.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "oci" {
|
||||
# 使用 ~/.oci/config 中的配置
|
||||
# 如果 ~/.oci/config 已正确配置,以下参数可以省略
|
||||
|
||||
# 或者显式指定配置(可选)
|
||||
# tenancy_ocid = "your-tenancy-ocid"
|
||||
# user_ocid = "your-user-ocid"
|
||||
# fingerprint = "your-fingerprint"
|
||||
# private_key_path = "~/.oci/oci_api_key.pem"
|
||||
# region = "us-phoenix-1"
|
||||
}
|
||||
|
||||
module "vcn" {
|
||||
source = "../../modules/vcn"
|
||||
|
||||
compartment_id = var.compartment_id
|
||||
vcn_name = "${var.environment}-vcn"
|
||||
cidr_block = "10.0.0.0/16"
|
||||
dns_label = "devvcn"
|
||||
}
|
||||
|
||||
module "compute" {
|
||||
source = "../../modules/compute"
|
||||
|
||||
compartment_id = var.compartment_id
|
||||
instance_name = "${var.environment}-instance"
|
||||
shape = "VM.Standard2.1"
|
||||
subnet_id = "ocid1.subnet.oc1..example" # 这里应该使用实际的子网 OCID
|
||||
}
|
||||
Reference in New Issue
Block a user