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]: aws_launch_template network_interfaces block missing primary_ipv6 #33733

Closed
johngmyers opened this issue Oct 3, 2023 · 6 comments · Fixed by #37142
Closed
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@johngmyers
Copy link

Description

Allow an AWS launch template to specify that a network interface should make an IPv6 address be primary. An instance must have a primary IPv6 address in order to be able to be an instance target of an IPv6 target group.

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

aws_launch_template

Potential Terraform Configuration

resource "aws_launch_template" "nodes-minimal-ipv6-example-com" {
  block_device_mappings {
    device_name = "/dev/xvda"
    ebs {
      delete_on_termination = true
      encrypted             = true
      iops                  = 3000
      throughput            = 125
      volume_size           = 128
      volume_type           = "gp3"
    }
  }
  iam_instance_profile {
    name = aws_iam_instance_profile.nodes-minimal-ipv6-example-com.id
  }
  image_id      = "ami-12345678"
  instance_type = "t3.medium"
  key_name      = aws_key_pair.kubernetes-minimal-ipv6-example-com-c4a6ed9aa889b9e2c39cd663eb9c7157.id
  lifecycle {
    create_before_destroy = true
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_protocol_ipv6          = "enabled"
    http_put_response_hop_limit = 1
    http_tokens                 = "optional"
  }
  monitoring {
    enabled = false
  }
  name = "nodes.minimal-ipv6.example.com"
  network_interfaces {
    associate_public_ip_address = false
    delete_on_termination       = true
    ipv6_address_count          = 1
    primary_ipv6                = true
    security_groups             = [aws_security_group.nodes-minimal-ipv6-example-com.id]
  }
  tag_specifications {
    resource_type = "instance"
    tags = {
      "KubernetesCluster"                                                          = "minimal-ipv6.example.com"
      "Name"                                                                       = "nodes.minimal-ipv6.example.com"
      "aws-node-termination-handler/managed"                                       = ""
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "nodes"
      "kubernetes.io/cluster/minimal-ipv6.example.com"                             = "owned"
    }
  }
  tag_specifications {
    resource_type = "volume"
    tags = {
      "KubernetesCluster"                                                          = "minimal-ipv6.example.com"
      "Name"                                                                       = "nodes.minimal-ipv6.example.com"
      "aws-node-termination-handler/managed"                                       = ""
      "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
      "k8s.io/role/node"                                                           = "1"
      "kops.k8s.io/instancegroup"                                                  = "nodes"
      "kubernetes.io/cluster/minimal-ipv6.example.com"                             = "owned"
    }
  }
  tags = {
    "KubernetesCluster"                                                          = "minimal-ipv6.example.com"
    "Name"                                                                       = "nodes.minimal-ipv6.example.com"
    "aws-node-termination-handler/managed"                                       = ""
    "k8s.io/cluster-autoscaler/node-template/label/node-role.kubernetes.io/node" = ""
    "k8s.io/role/node"                                                           = "1"
    "kops.k8s.io/instancegroup"                                                  = "nodes"
    "kubernetes.io/cluster/minimal-ipv6.example.com"                             = "owned"
  }
  user_data = filebase64("${path.module}/data/aws_launch_template_nodes.minimal-ipv6.example.com_user_data")
}

References

https://aws.amazon.com/about-aws/whats-new/2023/08/amazon-vpc-primary-ipv6-address-elastic-interface/

Would you like to implement a fix?

None

@johngmyers johngmyers added the enhancement Requests to existing resources that expand the functionality or scope. label Oct 3, 2023
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

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 the service/ec2 Issues and PRs that pertain to the ec2 service. label Oct 3, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 3, 2023
@oliviassss
Copy link

@johngmyers, thanks for opening this issue. I'm not familiar with terraform, but just wondering do we also need to update the eks-cluster template for the missing field to enable primary ipv6? Or it will respect the value in aws_launch_template
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster

@johngmyers
Copy link
Author

@oliviassss This shouldn't affect the aws_eks_cluster resource itself. It's just that the launch template for any node in the cluster will need this setting in order for it to be an instance target of an IPv6 target group. (Or something else would have to promote one of the instance's IPv6 addresses to primary.)

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Oct 26, 2023
Copy link

github-actions bot commented Jul 5, 2024

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.58.0 milestone Jul 5, 2024
Copy link

This functionality has been released in v5.58.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!

Copy link

I'm going to lock this issue 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 similar to this, 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 Aug 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
3 participants