Skip to content

Commit 1a9b63b

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

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ allow_github_webhooks = true
267267
| [aws_lb_listener_rule.unauthenticated_access_for_cidr_blocks](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener_rule) | resource |
268268
| [aws_lb_listener_rule.unauthenticated_access_for_webhook](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener_rule) | resource |
269269
| [aws_route53_record.atlantis](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
270+
| [aws_route53_record.atlantis_aaaa](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
270271
| [aws_ssm_parameter.atlantis_bitbucket_user_token](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter) | resource |
271272
| [aws_ssm_parameter.atlantis_github_user_token](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter) | resource |
272273
| [aws_ssm_parameter.atlantis_gitlab_user_token](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter) | resource |
@@ -292,6 +293,7 @@ allow_github_webhooks = true
292293
| <a name="input_alb_http_security_group_tags"></a> [alb\_http\_security\_group\_tags](#input\_alb\_http\_security\_group\_tags) | Additional tags to put on the http security group | `map(string)` | `{}` | no |
293294
| <a name="input_alb_https_security_group_tags"></a> [alb\_https\_security\_group\_tags](#input\_alb\_https\_security\_group\_tags) | Additional tags to put on the https security group | `map(string)` | `{}` | no |
294295
| <a name="input_alb_ingress_cidr_blocks"></a> [alb\_ingress\_cidr\_blocks](#input\_alb\_ingress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all ingress rules of the ALB. | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
296+
| <a name="input_alb_ip_address_type"></a> [alb\_ip\_address\_type](#input\_alb\_ip\_address\_type) | The type of IP addresses used by the subnets for your load balancer | `string` | `"ipv4"` | no |
295297
| <a name="input_alb_listener_ssl_policy_default"></a> [alb\_listener\_ssl\_policy\_default](#input\_alb\_listener\_ssl\_policy\_default) | The security policy if using HTTPS externally on the load balancer. [See](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html). | `string` | `"ELBSecurityPolicy-2016-08"` | no |
296298
| <a name="input_alb_log_bucket_name"></a> [alb\_log\_bucket\_name](#input\_alb\_log\_bucket\_name) | S3 bucket (externally created) for storing load balancer access logs. Required if alb\_logging\_enabled is true. | `string` | `""` | no |
297299
| <a name="input_alb_log_location_prefix"></a> [alb\_log\_location\_prefix](#input\_alb\_log\_location\_prefix) | S3 prefix within the log\_bucket\_name under which logs are stored. | `string` | `""` | no |
@@ -332,7 +334,8 @@ allow_github_webhooks = true
332334
| <a name="input_container_memory"></a> [container\_memory](#input\_container\_memory) | The amount (in MiB) of memory used by the atlantis container. If not specified ecs\_task\_memory will be used | `number` | `null` | no |
333335
| <a name="input_container_memory_reservation"></a> [container\_memory\_reservation](#input\_container\_memory\_reservation) | The amount of memory (in MiB) to reserve for the container | `number` | `128` | no |
334336
| <a name="input_create_ecs_cluster"></a> [create\_ecs\_cluster](#input\_create\_ecs\_cluster) | Whether to create an ECS cluster or not | `bool` | `true` | no |
335-
| <a name="input_create_route53_record"></a> [create\_route53\_record](#input\_create\_route53\_record) | Whether to create Route53 record for Atlantis | `bool` | `true` | no |
337+
| <a name="input_create_route53_aaaa_record"></a> [create\_route53\_aaaa\_record](#input\_create\_route53\_aaaa\_record) | Whether to create Route53 AAAA record for Atlantis | `bool` | `false` | no |
338+
| <a name="input_create_route53_record"></a> [create\_route53\_record](#input\_create\_route53\_record) | Whether to create Route53 A record for Atlantis | `bool` | `true` | no |
336339
| <a name="input_custom_container_definitions"></a> [custom\_container\_definitions](#input\_custom\_container\_definitions) | A list of valid container definitions provided as a single valid JSON document. By default, the standard container definition is used. | `string` | `""` | no |
337340
| <a name="input_custom_environment_secrets"></a> [custom\_environment\_secrets](#input\_custom\_environment\_secrets) | List of additional secrets the container will use (list should contain maps with `name` and `valueFrom`) | <pre>list(object(<br> {<br> name = string<br> valueFrom = string<br> }<br> ))</pre> | `[]` | no |
338341
| <a name="input_custom_environment_variables"></a> [custom\_environment\_variables](#input\_custom\_environment\_variables) | List of additional environment variables the container will use (list should contain maps with `name` and `value`) | <pre>list(object(<br> {<br> name = string<br> value = string<br> }<br> ))</pre> | `[]` | no |

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)