erc 모듈화, vpc public dns 설정 등
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
resource "aws_subnet" "subnets" {
|
||||
vpc_id = var.vpc_id
|
||||
# module.vpc_hq.vpc_hq_id
|
||||
|
||||
for_each = var.subnet-az-list
|
||||
availability_zone = each.value.name
|
||||
cidr_block = each.value.cidr
|
||||
|
||||
map_public_ip_on_launch = true
|
||||
|
||||
tags = {
|
||||
Name = "${var.vpc_id}-${each.value.name}"
|
||||
# Name = module.vpc_hq.vpcHq.id
|
||||
}
|
||||
}
|
0
modules/vpc-subnet/outputs.tf
Normal file
0
modules/vpc-subnet/outputs.tf
Normal file
29
modules/vpc-subnet/valiables.tf
Normal file
29
modules/vpc-subnet/valiables.tf
Normal file
@ -0,0 +1,29 @@
|
||||
variable "vpc_id" {
|
||||
description = "set vpc id"
|
||||
type = string
|
||||
}
|
||||
|
||||
// reference | https://github.com/davidcsi/terraform/blob/master/healthchecks/main.tf
|
||||
variable "subnet-az-list" {
|
||||
description = "Subnet available zone & cidr"
|
||||
type = map(map(string))
|
||||
# default = {
|
||||
# "zone-a" = {
|
||||
# name = "ap-northeast-2a"
|
||||
# cidr = "10.3.1.0/24"
|
||||
# }
|
||||
# "zone-b" = {
|
||||
# name = "ap-northeast-2b"
|
||||
# cidr = "10.3.2.0/24"
|
||||
# }
|
||||
# "zone-c" = {
|
||||
# name = "ap-northeast-2c"
|
||||
# cidr = "10.3.3.0/24"
|
||||
# }
|
||||
# "zone-d" = {
|
||||
# name = "ap-northeast-2d"
|
||||
# cidr = "10.3.4.0/24"
|
||||
# }
|
||||
# }
|
||||
|
||||
}
|
Reference in New Issue
Block a user