39 lines
1.0 KiB
Terraform
39 lines
1.0 KiB
Terraform
|
locals {
|
||
|
default-tags = {
|
||
|
Owner : "ken2026",
|
||
|
Environment : "lab"
|
||
|
TerraformDir = join("/", reverse(slice(reverse(split("/", path.cwd)), 0, 2)))
|
||
|
}
|
||
|
}
|
||
|
|
||
|
data "alicloud_regions" "this" {
|
||
|
}
|
||
|
|
||
|
data "alicloud_zones" "this" {
|
||
|
available_disk_category = "cloud_efficiency"
|
||
|
available_resource_creation = "VSwitch"
|
||
|
multi = true
|
||
|
}
|
||
|
|
||
|
module "network-with-security-group" {
|
||
|
source = "terraform-alicloud-modules/network-with-security-group/alicloud"
|
||
|
version = "1.2.0"
|
||
|
|
||
|
create_vpc = true
|
||
|
use_existing_vpc = false
|
||
|
vpc_name = "lab-ken2026"
|
||
|
vpc_cidr = "172.16.0.0/16"
|
||
|
vpc_description = "Lab vpc for ken2026"
|
||
|
vpc_tags = local.default-tags
|
||
|
|
||
|
vswitch_cidrs = cidrsubnets("172.16.0.0/16", 8, 8)
|
||
|
availability_zones = data.alicloud_zones.this.ids
|
||
|
vswitch_name = "lab-ken2026-subnet"
|
||
|
use_num_suffix = false
|
||
|
vswitch_description = "Lab subnet for ken2026"
|
||
|
vswitch_tags = local.default-tags
|
||
|
|
||
|
create_security_group = false
|
||
|
}
|
||
|
|