Skip to content

feat: Add IPv6 support (ALB and Route53 AAAA record) #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 1, 2022

Conversation

bodgit
Copy link
Contributor

@bodgit bodgit commented Feb 15, 2022

Description

This PR enables IPv6 support for the VPC, ALB and adds a AAAA Route53 record.

Motivation and Context

I need to run Atlantis with IPv6 connectivity. I manage the VPC outside of this module so that already has IPv6 enabled so primarily I just needed to change the ALB to "dualstack" and add the AAAA record. I've added additional variables so if the VPC is managed by this module the same configuration can be achieved.

Breaking Changes

None. The new enable_ipv6 variable defaults to false so existing IPv4-only behaviour is preserved.

How Has This Been Tested?

  • I have tested and validated these changes using one or more of the provided examples/* projects
    This will perhaps need a new example?

@bodgit bodgit changed the title Add IPv6 support feat: Add IPv6 support Feb 15, 2022
@bryantbiggs
Copy link
Member

I think we can add the AAAA record, but if users want to use IPv6 then I think they should use an externally created VPC module otherwise we're slowly going to pull in that entire module here

@bodgit
Copy link
Contributor Author

bodgit commented Feb 18, 2022

I think we can add the AAAA record, but if users want to use IPv6 then I think they should use an externally created VPC module otherwise we're slowly going to pull in that entire module here

That's what I'm doing anyway. I was managing the AAAA record separately too, the only necessary feature really is to be able to set the ALB ip_address_type attribute to "dualstack".

Should I just reduce the PR to exposing an alb_ip_address_type variable and then make the AAAA record conditional on that being set to "dualstack"?

main.tf Outdated
@@ -234,6 +242,8 @@ module "alb" {
prefix = var.alb_log_location_prefix
}

ip_address_type = var.enable_ipv6 ? "dualstack" : "ipv4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya lets just make this

Suggested change
ip_address_type = var.enable_ipv6 ? "dualstack" : "ipv4"
ip_address_type = var.alb_ip_address_type

And the variable default will be "ipv4" like the ALB module does

main.tf Outdated
@@ -421,6 +431,20 @@ resource "aws_route53_record" "atlantis" {
}
}

resource "aws_route53_record" "atlantis-AAAA" {
count = var.create_route53_record && var.enable_ipv6 ? 1 : 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can simplify and do

Suggested change
count = var.create_route53_record && var.enable_ipv6 ? 1 : 0
count = var.create_route53_aaaa_record ? 1 : 0

@bryantbiggs
Copy link
Member

I think we can add the AAAA record, but if users want to use IPv6 then I think they should use an externally created VPC module otherwise we're slowly going to pull in that entire module here

That's what I'm doing anyway. I was managing the AAAA record separately too, the only necessary feature really is to be able to set the ALB ip_address_type attribute to "dualstack".

Should I just reduce the PR to exposing an alb_ip_address_type variable and then make the AAAA record conditional on that being set to "dualstack"?

ya see the two comments above, and then we can just drop the VPC module changes from here

Copy link
Member

@bryantbiggs bryantbiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me - what do you think @antonbabenko

Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please update the docs (run pre-commit run -a and commit changes).

main.tf Outdated
@@ -421,6 +423,20 @@ resource "aws_route53_record" "atlantis" {
}
}

resource "aws_route53_record" "atlantis-AAAA" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resource "aws_route53_record" "atlantis-AAAA" {
resource "aws_route53_record" "atlantis_aaaa" {

lowercase and _

@bodgit
Copy link
Contributor Author

bodgit commented Feb 18, 2022

I was wondering how you ran terraform-docs, that answers that 😄

Docs updated.

Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment before merging.

@github-actions
Copy link

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label Mar 21, 2022
@github-actions
Copy link

github-actions bot commented Apr 1, 2022

This PR was automatically closed because of stale in 10 days

@github-actions github-actions bot closed this Apr 1, 2022
@bodgit
Copy link
Contributor Author

bodgit commented Apr 1, 2022

@bryantbiggs @antonbabenko can this be reopened and merged please? I'm not aware of any outstanding issues with it

(I really hate stale bots)

@antonbabenko
Copy link
Member

antonbabenko commented Apr 1, 2022

@bodgit Apologies for the delay with this PR. Mentioning my username when something has been finished helps me a lot!

@antonbabenko antonbabenko reopened this Apr 1, 2022
@antonbabenko antonbabenko changed the title feat: Add IPv6 support feat: Add IPv6 support (ALB and Route53 AAAA record) Apr 1, 2022
@antonbabenko antonbabenko merged commit 6cefda0 into terraform-aws-modules:master Apr 1, 2022
antonbabenko pushed a commit that referenced this pull request Apr 1, 2022
## [3.14.0](v3.13.1...v3.14.0) (2022-04-01)

### Features

* Add IPv6 support (ALB and Route53 AAAA record) ([#256](#256)) ([6cefda0](6cefda0))
@antonbabenko
Copy link
Member

This PR is included in version 3.14.0 🎉

@bodgit bodgit deleted the ipv6 branch April 4, 2022 20:07
titanlien pushed a commit to Flaconi/terraform-aws-atlantis that referenced this pull request Jun 8, 2022
titanlien pushed a commit to Flaconi/terraform-aws-atlantis that referenced this pull request Jun 8, 2022
titanlien pushed a commit to Flaconi/terraform-aws-atlantis that referenced this pull request Jun 8, 2022
titanlien pushed a commit to Flaconi/terraform-aws-atlantis that referenced this pull request Jun 8, 2022
titanlien pushed a commit to Flaconi/terraform-aws-atlantis that referenced this pull request Jun 9, 2022
titanlien pushed a commit to Flaconi/terraform-aws-atlantis that referenced this pull request Jun 9, 2022
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants