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 Retrieving EIP #122

Closed
hhff opened this issue Jul 30, 2014 · 12 comments
Closed

Error Retrieving EIP #122

hhff opened this issue Jul 30, 2014 · 12 comments
Labels

Comments

@hhff
Copy link

hhff commented Jul 30, 2014

Guys! I'm loving Terraform. I'm not a devops person, so this is really appealing to me.

So I'm running through the Terraform tutorial - and I hit a snag.

I'm at the Provisioners step - and I accidentally ran

terraform apply

before deleting my previous infra.

Now I'm getting this error:

Error refreshing state: Error retrieving EIP: Invalid value 'eipalloc-xxxxxxxx' for PublicIp. Not a valid IPv4 address. (InvalidParameterValue)

(redacted the actual key in the above)

Any ideas why this is happening?

@pearkes
Copy link
Contributor

pearkes commented Jul 30, 2014

I imagine your configuration needs to have the vpc attribute set to true for the EIP resource to correctly retrieve the EIP by it's ID.

EIP has 2 unique IDs, depending on how you're using them. It's pretty frustrating, but to use it inside of a vpc, you set the attribute to true as above and it will use the allocation ID. If you're using EC2 Classic EIPs, it uses the IP address as the unique ID.

Can you try that or post your configuration? Thanks!

@pearkes pearkes added the bug label Jul 30, 2014
@hhff
Copy link
Author

hhff commented Jul 30, 2014

Thanks @pearkes !

I just tried adding `vpc = "true"`` to my EIP resource - but no luck.

Here's my config:

provider "aws" {
    access_key = "xxxx"
    secret_key = "xxxx"
    region = "us-east-1"
}

resource "aws_instance" "example" {
    ami = "ami-aa7ab6c2"
    instance_type = "t1.micro"
}

resource "aws_eip" "ip" {
    instance = "${aws_instance.example.id}"
    vpc = "true"
}

Any ideas?

@hhff
Copy link
Author

hhff commented Aug 6, 2014

@pearkes is this resolved? Really wanting to use Terraform on an upcoming project!

@mitchellh
Copy link
Contributor

This should be fixed now. If you want to give it a try from master you're welcome to.

@hhff
Copy link
Author

hhff commented Aug 20, 2014

thanks @mitchellh ! What's the best way to update Terraform? Do I need to build it myself? I don't have Go or any of it's deps

@mitchellh
Copy link
Contributor

@hhff The README contains info on how to compile, should be descriptive enough (towards the bottom)

@hhff
Copy link
Author

hhff commented Aug 20, 2014

kk. Will let you know when i get around to trying it out.

Big love!

@wilb
Copy link

wilb commented Aug 28, 2014

Just built the latest terraform from master to try and work around this, but I still seem to be hitting it.

Worked through the examples, created an elastic IP, tried to destroy but getting the exact same error as above. I can't do a "terraform refresh", a " terraform plan -destroy -out=terraform.tfplan" or "terraform apply" after deleting my resources from my config file. All commands give me a:

"Error refreshing state: Error retrieving EIP: Invalid value 'eipalloc-xxxxxxxx' for PublicIp. Not a valid IPv4 address. (InvalidParameterValue)"

@wilb
Copy link

wilb commented Aug 28, 2014

Just read a comment on another thread saying "The eip is created and deleted fine. It looks like the problem still exists if the vcp = "true" is applied after the eip is already created which might explain why the poster of #122 was still getting the error. Creating from scratch does not reproduce the error." - I'll throw away all of my resources manually and start afresh now I'm running against the dev version.

@mitchellh
Copy link
Contributor

@wilb Oof. If you can come up with some steps to reproduce this error, I'd gladly fix it, but I've been having trouble getting it to show.

@wilb
Copy link

wilb commented Aug 28, 2014

I pretty much followed your intro walkthrough using the 0.1.1 from your site - don't think I changed very much at all! I then built the dev version to see if it fixed it as per above, no go though.

I'll see if I can recreate it and let you know.

@wilb
Copy link

wilb commented Aug 29, 2014

I've just run through the same steps from start to finish with the dev version and all seems to have worked fine.

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

No branches or pull requests

4 participants