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

Version 3.71: error creating EC2 Subnet: InvalidParameter: The parameter ipv6Native is not recognized #22498

Closed
aswad-finaccel opened this issue Jan 10, 2022 · 7 comments · Fixed by #22531
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@aswad-finaccel
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.13.5

  • provider registry.terraform.io/hashicorp/aws v3.71.0

Affected Resource(s)

  • aws_subnet

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

provider "aws" {
  version = "= 3.71"
}

resource "aws_subnet" "test" {
  vpc_id     = "vpc-xxx"
  cidr_block = "172.31.80.0/20"
}

Debug Output

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_subnet.test will be created
  + resource "aws_subnet" "test" {
      + arn                                            = (known after apply)
      + assign_ipv6_address_on_creation                = false
      + availability_zone                              = (known after apply)
      + availability_zone_id                           = (known after apply)
      + cidr_block                                     = "172.31.80.0/20"
      + enable_dns64                                   = false
      + enable_resource_name_dns_a_record_on_launch    = false
      + enable_resource_name_dns_aaaa_record_on_launch = false
      + id                                             = (known after apply)
      + ipv6_cidr_block_association_id                 = (known after apply)
      + ipv6_native                                    = false
      + map_public_ip_on_launch                        = false
      + owner_id                                       = (known after apply)
      + private_dns_hostname_type_on_launch            = (known after apply)
      + tags_all                                       = (known after apply)
      + vpc_id                                         = "vpc-xxx"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

aws_subnet.test: Creating...

Error: error creating EC2 Subnet: InvalidParameter: The parameter ipv6Native is not recognized
        status code: 400, request id: xxx

  on main.tf line 5, in resource "aws_subnet" "test":
   6: resource "aws_subnet" "test" {

Expected Behavior

AWS subnet should be created without error.

Actual Behavior

Failed with error as above.

Steps to Reproduce

  1. terraform apply

Important Factoids

Using older version ie 3.70 did not produce any error and the subnet resource was created successfully. So the issue is only on version 3.71

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/ec2 Issues and PRs that pertain to the ec2 service. labels Jan 10, 2022
@ewbankkit
Copy link
Contributor

@aswad-finaccel Thanks for raising this issue.
Which AWS Partition (Commercial, China, US GovCloud etc.) are you using?

@ewbankkit ewbankkit added waiting-response Maintainers are waiting on response from community or contributor. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 10, 2022
@ewbankkit
Copy link
Contributor

ewbankkit commented Jan 10, 2022

If the Ipv6Native parameter is not supported in some AWS Partitions then the solution would be to only set the parameter on subnet creation if it's true:

input := &ec2.CreateSubnetInput{
AvailabilityZone: aws.String(d.Get("availability_zone").(string)),
AvailabilityZoneId: aws.String(d.Get("availability_zone_id").(string)),
Ipv6Native: aws.Bool(d.Get("ipv6_native").(bool)),
TagSpecifications: ec2TagSpecificationsFromKeyValueTags(tags, ec2.ResourceTypeSubnet),
VpcId: aws.String(d.Get("vpc_id").(string)),
}

Relates: #22339.

@aswad-finaccel
Copy link
Author

I am using new region ap-southeast-3. Do you mean, this parameter Ipv6Native, depends on which region we are using. I will do some test with other regions tomorrow. Thanks for the info.

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Jan 10, 2022
@aswad-finaccel
Copy link
Author

I tested with older region ap-southeast-1 (Singapore), version 3.71 works fine. Seems like this new region ap-southeast-3 (Jakarta) still does not support ipv6 subnets, as stated in following link:
https://aws.amazon.com/blogs/networking-and-content-delivery/introducing-ipv6-only-subnets-and-ec2-instances/

I wonder if the code could be modified so that if we do not provide ipv6_native parameter then it will be ignored rather than set to false. Therefore we can use newer version of this provider in regions which still does not support ipv6 subnets.

@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Jan 11, 2022
@github-actions github-actions bot added this to the v3.72.0 milestone Jan 11, 2022
@aashari
Copy link

aashari commented Jan 13, 2022

thanks @aswad-finaccel for raising this issue, reverting back to 3.70 solved for now, looking forward for this changes to be released

@github-actions
Copy link

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

@github-actions
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 May 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
3 participants