Skip to content
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

[Enhancement]: add support for enable_primary_ipv6 flag for aws_instance, aws_vpc_network_interface and aws_launch_template #36424

Closed
arianvp opened this issue Mar 16, 2024 · 6 comments · Fixed by #36425
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. service/vpc Issues and PRs that pertain to the vpc service.
Milestone

Comments

@arianvp
Copy link
Contributor

arianvp commented Mar 16, 2024

Description

In order to use IPV6 target groups (#35010 #36423 ) you need to set up your instance with a "Primary IPv6 address". For this you need to set the PrimaryIpv6 boolean on your network interface but the terraform provider doesn't expose this option

Affected Resource(s) and/or Data Source(s)

  • aws_instance
  • aws_launch_template
  • aws_network_interface

Potential Terraform Configuration

resource "aws_instance" "web" {
  ami           = data.aws_ami.ubuntu.id
  instance_type = "t3.micro"

  ipv6_address_count = 1
  enable_primary_ipv6  = true


  tags = {
    Name = "HelloWorld"
  }
}

resource "aws_launch_template" "web" {
  name          = "web"
  image_id      = data.aws_ami.nixos.id
  instance_type = "t3.micro"

  network_interfaces {
    ipv6_address_count = 1
    enable_primary_ipv6  = true
  }
}


resource "aws_vpc_network_interface" "test" {
  subnet_id           = aws_subnet.public_a.id
  ipv6_address_count  = 1
  enable_primary_ipv6 = true
}

References

For the aws_vpc_network_interface resource we need to use the EnablePrimaryIpv6 field in CreateNetworkInterface https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html

For the aws_launch_template resource we need to set the PrimaryIpv6 field https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_LaunchTemplateInstanceNetworkInterfaceSpecificationRequest.html

This functionality was announced here: https://aws.amazon.com/about-aws/whats-new/2023/08/amazon-vpc-primary-ipv6-address-elastic-interface/

Would you like to implement a fix?

No

@arianvp arianvp added the enhancement Requests to existing resources that expand the functionality or scope. label Mar 16, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/ec2 Issues and PRs that pertain to the ec2 service. service/vpc Issues and PRs that pertain to the vpc service. labels Mar 16, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 16, 2024
@arianvp arianvp changed the title [Enhancement]: add support for enable_primary_ipv6 flag for aws_network_interface and aws_launch_template [Enhancement]: add support for enable_primary_ipv6 flag for aws_instance, aws_network_interface and aws_launch_template Mar 16, 2024
@arianvp arianvp changed the title [Enhancement]: add support for enable_primary_ipv6 flag for aws_instance, aws_network_interface and aws_launch_template [Enhancement]: add support for enable_primary_ipv6 flag for aws_instance, aws_vpc_network_interface and aws_launch_template Mar 16, 2024
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Mar 18, 2024
@ankon
Copy link
Contributor

ankon commented Jun 24, 2024

Related/partial duplicate? #34038

@pdostal
Copy link

pdostal commented Jul 17, 2024

Hello, will be the enable_primary_ipv6 setting available also for aws_instance aws_network_interface? Thank you 🙏

@arianvp
Copy link
Contributor Author

arianvp commented Jul 17, 2024

Yes #36425 adds support for all those. I'm just waiting for someone to review it

Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.81.0 milestone Dec 12, 2024
Copy link

This functionality has been released in v5.81.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. service/vpc Issues and PRs that pertain to the vpc service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants