Skip to content

Commit d9cbed8

Browse files
committed
Add IPv6 support
1 parent 2df6bd6 commit d9cbed8

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

main.tf

+18-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ data "aws_partition" "current" {}
131131
data "aws_region" "current" {}
132132

133133
data "aws_route53_zone" "this" {
134-
count = var.create_route53_record ? 1 : 0
134+
count = var.create_route53_record || var.create_route53_aaaa_record ? 1 : 0
135135

136136
name = var.route53_zone_name
137137
private_zone = var.route53_private_zone
@@ -234,6 +234,8 @@ module "alb" {
234234
prefix = var.alb_log_location_prefix
235235
}
236236

237+
ip_address_type = var.alb_ip_address_type
238+
237239
enable_deletion_protection = var.alb_enable_deletion_protection
238240

239241
drop_invalid_header_fields = var.alb_drop_invalid_header_fields
@@ -405,7 +407,7 @@ module "acm" {
405407
}
406408

407409
################################################################################
408-
# Route53 record
410+
# Route53 records
409411
################################################################################
410412
resource "aws_route53_record" "atlantis" {
411413
count = var.create_route53_record ? 1 : 0
@@ -421,6 +423,20 @@ resource "aws_route53_record" "atlantis" {
421423
}
422424
}
423425

426+
resource "aws_route53_record" "atlantis-AAAA" {
427+
count = var.create_route53_aaaa_record ? 1 : 0
428+
429+
zone_id = data.aws_route53_zone.this[0].zone_id
430+
name = var.route53_record_name != null ? var.route53_record_name : var.name
431+
type = "AAAA"
432+
433+
alias {
434+
name = module.alb.lb_dns_name
435+
zone_id = module.alb.lb_zone_id
436+
evaluate_target_health = true
437+
}
438+
}
439+
424440
################################################################################
425441
# EFS
426442
################################################################################

variables.tf

+13-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ variable "route53_private_zone" {
231231
}
232232

233233
variable "create_route53_record" {
234-
description = "Whether to create Route53 record for Atlantis"
234+
description = "Whether to create Route53 A record for Atlantis"
235235
type = bool
236236
default = true
237237
}
@@ -688,3 +688,15 @@ variable "ephemeral_storage_size" {
688688
error_message = "The minimum supported value is 21 GiB and the maximum supported value is 200 GiB."
689689
}
690690
}
691+
692+
variable "alb_ip_address_type" {
693+
description = "The type of IP addresses used by the subnets for your load balancer"
694+
type = string
695+
default = "ipv4"
696+
}
697+
698+
variable "create_route53_aaaa_record" {
699+
description = "Whether to create Route53 AAAA record for Atlantis"
700+
type = bool
701+
default = false
702+
}

0 commit comments

Comments
 (0)