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

AWS EIP does not have attribute ID #77

Closed
hashibot opened this issue Jun 13, 2017 · 6 comments
Closed

AWS EIP does not have attribute ID #77

hashibot opened this issue Jun 13, 2017 · 6 comments
Labels
bug Addresses a defect in current functionality.

Comments

@hashibot
Copy link

This issue was originally opened by @elliottsam as hashicorp/terraform#5185. It was migrated here as part of the provider split. The original body of the issue is below.


Hi,
When trying to associate an EIP with a AWS NAT gateway, I am seeing the following error.

02:02:03 Error applying plan:
02:02:03 
02:02:03 1 error(s) occurred:
02:02:03 
02:02:03 * Resource 'aws_eip.nat' does not have attribute 'id' for variable 'aws_eip.nat.id'

This error occurs randomly and works normally 75% of the time, the logs show that the EIP was created before the NAT gateway.

@hashibot hashibot added the bug Addresses a defect in current functionality. label Jun 13, 2017
@hashibot
Copy link
Author

This comment was originally posted by @brikis98 as hashicorp/terraform#5185 (comment). It was migrated here as part of the provider split. The original comment is below.


Same problem here. As an added complexity, I'm using the count attribute on my aws_eip:

resource "aws_eip" "nat" {
    count = "${var.num_nat_gateways}"
    vpc = true
    depends_on = ["aws_internet_gateway.main"]
}

resource "aws_nat_gateway" "nat" {
    count = "${var.num_nat_gateways}"
    allocation_id = "${element(aws_eip.nat.*.id, count.index)}"
    subnet_id = "${element(aws_subnet.public.*.id, count.index)}"
    depends_on = ["aws_internet_gateway.main"]
}

The error I get intermittently is:

Resource 'aws_eip.nat' does not have attribute 'id' for variable 'aws_eip.nat.*.id'

@hashibot
Copy link
Author

This comment was originally posted by @brikis98 as hashicorp/terraform#5185 (comment). It was migrated here as part of the provider split. The original comment is below.


May be related to hashicorp/terraform#4944. I'm trying the depends_on workaround now too.

@hashibot
Copy link
Author

This comment was originally posted by @c4milo as hashicorp/terraform#5185 (comment). It was migrated here as part of the provider split. The original comment is below.


Even using depends_on, I have experienced sometimes AWS just taking more time than usual to replicate changes made by Terraform, causing this sort of errors to show up once in a while. Waiting for a little while and re-running terraform apply has worked for me.

@hashibot
Copy link
Author

This comment was originally posted by @skarungan as hashicorp/terraform#5185 (comment). It was migrated here as part of the provider split. The original comment is below.


Got the same issue, while using different state-files
terraform apply -state=dev.tfstate ---> Runs fine and succeeds
terraform apply -state=qa.tfstate ----> Throws the following error

Error applying plan:

1 error(s) occurred:

* Resource 'aws_eip.mgmt_nat_gw' does not have attribute 'id' for variable 'aws_eip.mgmt_nat_gw.id'

Re-running the command worked though

@Ninir
Copy link
Contributor

Ninir commented Aug 28, 2017

Hi folks,

Closing since it does not seem to happen as per the original issue.
Let us know if you still have the issue and we will re-open & discuss.

Thanks!

@Ninir Ninir closed this as completed Aug 28, 2017
@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 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 Apr 11, 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.
Projects
None yet
Development

No branches or pull requests

2 participants