Skip to content

Commit

Permalink
add ipv6 to dns
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jul 19, 2024
1 parent f3c1836 commit 4ee65ea
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions vpc-interface-endpoint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ These are not included in the module because they don't exist until the resource
| [aws_route53_record.vpce](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_route53_record.vpce_heritage_txt](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_route53_record.vpce_info_txt](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_route53_record.vpce_ipv6](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_route53_record.vpce_ptr](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_route53_record.vpce_ptr_info](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
| [aws_route53_record.vpce_wildcard](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
Expand Down
6 changes: 4 additions & 2 deletions vpc-interface-endpoint/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ resource "aws_vpc_endpoint" "interface_endpoint" {
private_dns_enabled = var.private_dns_enabled
auto_accept = true

ip_address_type = var.ip_address_type
dns_record_ip_type = var.ip_address_type
ip_address_type = var.ip_address_type
dns_options {
dns_record_ip_type = var.ip_address_type
}

tags = merge(
local.base_tags,
Expand Down
9 changes: 9 additions & 0 deletions vpc-interface-endpoint/route53.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ resource "aws_route53_record" "vpce" {
records = [for n in data.aws_network_interface.vpce : n.private_ip]
}

resource "aws_route53_record" "vpce_ipv6" {
count = local.r53_create && local.endpoint_exists && length(data.aws_network_interface.vpce.ipv6_addresses) > 0 ? 1 : 0
zone_id = try(aws_route53_zone.vpce[0].zone_id, null)
name = try(aws_route53_zone.vpce[0].name, null)
type = "AAAA"
ttl = "60"
records = [for n in data.aws_network_interface.vpce : n.ipv6_addresses]
}

resource "aws_route53_record" "vpce_wildcard" {
count = local.r53_create && local.endpoint_exists && local.is_wildcard ? 1 : 0
zone_id = try(aws_route53_zone.vpce[0].zone_id, null)
Expand Down

0 comments on commit 4ee65ea

Please sign in to comment.