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

provider/aws: Can't create an aws_instance in a VPC with an auto-generated IPv6 address #13250

Closed
bryanburgers opened this issue Mar 31, 2017 · 4 comments · Fixed by #13702
Closed

Comments

@bryanburgers
Copy link
Contributor

Terraform Version

$ terraform -v
Terraform v0.9.2

(Also got the same error on v0.9.1)

Affected Resource(s)

  • aws_instance

Terraform Configuration Files

provider "aws" {
  region = "us-east-2"
}

resource "aws_instance" "test" {
  ami = "ami-fcc19b99"
  instance_type = "t2.small"
  subnet_id = "subnet-[redacted]"
  associate_public_ip_address = true
  ipv6_address_count = 1
  key_name = "[redacted]"
  tags = {
    Name = "test"
  }
}

Debug Output

Debug output
$ terraform apply
aws_instance.test: Creating...
  ami:                         "" => "ami-fcc19b99"
  associate_public_ip_address: "" => "true"
  availability_zone:           "" => "<computed>"
  ebs_block_device.#:          "" => "<computed>"
  ephemeral_block_device.#:    "" => "<computed>"
  instance_state:              "" => "<computed>"
  instance_type:               "" => "t2.small"
  ipv6_address_count:          "" => "1"
  ipv6_addresses.#:            "" => "<computed>"
  key_name:                    "" => "OhioDev"
  network_interface_id:        "" => "<computed>"
  placement_group:             "" => "<computed>"
  private_dns:                 "" => "<computed>"
  private_ip:                  "" => "<computed>"
  public_dns:                  "" => "<computed>"
  public_ip:                   "" => "<computed>"
  root_block_device.#:         "" => "<computed>"
  security_groups.#:           "" => "<computed>"
  source_dest_check:           "" => "true"
  subnet_id:                   "" => "subnet-[redacted]"
  tags.%:                      "" => "1"
  tags.Name:                   "" => "test"
  tenancy:                     "" => "<computed>"
  vpc_security_group_ids.#:    "" => "<computed>"
Error applying plan:

1 error(s) occurred:

* aws_instance.test: 1 error(s) occurred:

* aws_instance.test: Error launching source instance: InvalidParameterCombination: Network interfaces and an instance-level IPv6 address count may not be specified on the same request
        status code: 400, request id: [redacted]

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Expected Behavior

Like assign_public_ip = true auto-assigns an IPv4 address to the instance, I would hope/expect that ipv6_address_count = 1 would auto-assign an IPv6 address to the instance.

Actual Behavior

Error launching source instance: InvalidParameterCombination: Network interfaces and an instance-level IPv6 address count may not be specified on the same request

Steps to Reproduce

  1. terraform apply

Related

#10538 #12933 #10538

@txbm
Copy link

txbm commented Apr 9, 2017

I am running into this issue as well. Is there an anticipated go-forward plan for this @radeksimko or are we on our own for a bit?

@bryanburgers
Copy link
Contributor Author

bryanburgers commented Apr 10, 2017

I'm curious if it's right around here in resource_aws_instance.go: if a public IP is requested, then we make a new NetworkInterface, which then conflicts with the request for IPv6 addresses.

So my guess is, if we go through the effort of creating a network interface because we have a public IP address, we should then call SetIpv6AddressCount (or SetIpv6Addresses) on the InstanceNetworkInterfaceSpecification near line 1263 rather than on the RunInstancesInput near line 382.

bryanburgers added a commit to bryanburgers/terraform that referenced this issue Apr 17, 2017
Fix an issue when trying to get a public IPv4 address and a public IPv6
address that results in the following error:

    Error launching source instance: InvalidParameterCombination:
    Network interfaces and an instance-level IPv6 address count may not
    be specified on the same request

To fix, in situations where we want a IPv6 addresses AND we need to
manually specify network interfaces on the instance, create the IPv6
addresses on the network interface that we're creating rather than on
the instance itself.

Fixes hashicorp#13250
@sandnabba
Copy link

Hi! I've run into the same issue. Found a work around by assigning elastic IP's for IPv4.
But then I run into GH-14032 instead.

bryanburgers added a commit to bryanburgers/terraform that referenced this issue May 2, 2017
Fix an issue when trying to get a public IPv4 address and a public IPv6
address that results in the following error:

    Error launching source instance: InvalidParameterCombination:
    Network interfaces and an instance-level IPv6 address count may not
    be specified on the same request

To fix, in situations where we want a IPv6 addresses AND we need to
manually specify network interfaces on the instance, create the IPv6
addresses on the network interface that we're creating rather than on
the instance itself.

Fixes hashicorp#13250
bryanburgers added a commit to bryanburgers/terraform that referenced this issue May 12, 2017
Fix an issue when trying to get a public IPv4 address and a public IPv6
address that results in the following error:

    Error launching source instance: InvalidParameterCombination:
    Network interfaces and an instance-level IPv6 address count may not
    be specified on the same request

To fix, in situations where we want a IPv6 addresses AND we need to
manually specify network interfaces on the instance, create the IPv6
addresses on the network interface that we're creating rather than on
the instance itself.

Fixes hashicorp#13250
@ghost
Copy link

ghost commented Apr 11, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants