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

Error refreshing state: Invalid address to set #4986

Closed
ghost opened this issue Jun 26, 2018 · 4 comments
Closed

Error refreshing state: Invalid address to set #4986

ghost opened this issue Jun 26, 2018 · 4 comments
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.

Comments

@ghost
Copy link

ghost commented Jun 26, 2018

This issue was originally opened by @zakkg3 as hashicorp/terraform#18332. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.11.7
+ provider.aws v1.24.0
+ provider.template v1.0.0

Terraform Configuration Files

resource "aws_network_interface" "in_drone_ci_ntw_iface" {
  subnet_id       = "${data.terraform_remote_state.network.vpc_zone_identifier[0]}"
}
resource "aws_launch_template" "rancher_hosts_ci_template" {
... more code here
  network_interfaces {
  associate_public_ip_address = false
  network_interface_id = "${aws_network_interface.in_drone_ci_ntw_iface.id}"
 # this was the apply that generated the problem
  ipv4_addresses  = ["${aws_network_interface.in_drone_ci_ntw_iface.*.private_ips}"]
  }
}

Actual Behavior

Error: Error refreshing state: 1 error(s) occurred:

  • aws_launch_template.rancher_hosts_ci: aws_launch_template.rancher_hosts_ci: Invalid address to set: []string{"network_interfaces", "0", "ipv4_addresses"}

Steps to Reproduce

First I run terraform apply to try to link the ENI in the launch template using ipv4_addresses attribute
ipv4_addresses = ["${aws_network_interface.in_drone_ci_ntw_iface.*.private_ips}"]

and from this point, cannot refresh the state any more.

References

looks like hashicorp/terraform#5108
but with the launch_template and ipv4_adresses

@bflad bflad added bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. labels Jun 26, 2018
@dawidmalina
Copy link

I have exactly the same issue with the latest terraform-provider-aws

resource "aws_launch_template" "main" {
...
  network_interfaces {
    ipv4_addresses = ["${cidrhost(element(var.SUBNETS, count.index), 5)}"]
  }
...
* aws_launch_template.main.0: Invalid address to set: []string{"network_interfaces", "0", "ipv4_addresses"}

@dawidmalina
Copy link

dawidmalina commented Nov 19, 2018

This looks like similar issue which was fixed for ipv6 #5883

Related ticket: #5863

@bflad
Copy link
Contributor

bflad commented Mar 17, 2020

Hi folks 👋 It appears this might have been fixed awhile ago, but never closed. #12307 adds an acceptance test which currently passes against the latest codebase.

If you are still having trouble on the latest version of Terraform and the Terraform AWS Provider, please open a new bug report and we will take a fresh look. Thanks!

@bflad bflad closed this as completed Mar 17, 2020
@ghost
Copy link
Author

ghost commented Jul 2, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Jul 2, 2020
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
Development

No branches or pull requests

2 participants