route53 add

This commit is contained in:
2023-01-11 20:21:43 +09:00
parent c96cac92b9
commit e9c35f55b5
11 changed files with 143 additions and 227 deletions

View File

@ -0,0 +1,20 @@
resource "aws_route53_record" "default" {
count = var.type_alias ? 0 : 1
zone_id = var.zone_id
name = var.prefix
type = var.type
ttl = var.ttl
records = var.record_list
}
resource "aws_route53_record" "alias" {
count = var.type_alias ? 1 : 0
zone_id = var.zone_id
name = var.name
type = var.type
ttl = var.ttl
records = var.record_list
}

View File

View File

@ -0,0 +1,20 @@
variable "zone_id" {
description = "set host-zone id"
type = string
}
variable "prefix" {
description = "set host-zone id"
type = string
}
variable "type" {
description = "set host-zone id"
type = string
}
variable "ttl" {
description = "set host-zone id"
type = string
}
variable "record_list" {
description = "set host-zone id"
type = list(string)
}

View File

@ -1,9 +1,5 @@
resource "aws_route53_zone" "primary" {
name = var.name
//public 이면 vpc 불필요
count = var.public ? 0 : 1
vpc {
vpc_id = var.vpc_id
}
comment = "hq-dns-server"
}

View File

@ -1,3 +1,4 @@
output "id" {
value = aws_route53_zone.primary.id
output "zone_id" {
value = aws_route53_zone.primary.zone_id
}

View File

@ -2,13 +2,3 @@ variable "name" {
description = "route53 name"
type = string
}
variable "public" {
description = "route53 name"
type = bool
}
variable "vpc_id" {
description = "vpc_id"
type = string
}