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

providers/aws: check allocationId only if it's vpc, fixes #1345 #1555

Merged
merged 1 commit into from
Apr 20, 2015
Merged

providers/aws: check allocationId only if it's vpc, fixes #1345 #1555

merged 1 commit into from
Apr 20, 2015

Conversation

fatih
Copy link
Contributor

@fatih fatih commented Apr 16, 2015

EIP with VPC only returns an allocationID. However, for standard we need
to lookup for PublicIP. When we use an example for standard EC2 instance
(here t1.micro):

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

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

then in this case, allocationID will be nil, but publicIP will be non
nil (which is used later for association the IP). So check for
allocationId only if it's of domain VPC.

EIP with VPC only returns an allocationID. However, for standard we need
to lookup for PublicIP. When we use an example for standard EC2 instance
(here `t1.micro`):

```
resource "aws_instance" "example" {
    ami = "ami-25773a24"
    instance_type = "t1.micro"
}

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

```

then in this case, allocationID will be nil, but publicIP will be non
nil (which is used later for association the IP).  So check for
allocationId only if it's of domain `VPC`.
@mitchellh
Copy link
Contributor

LGTM. Thanks! The classic/non-classic case is always tricky here.

mitchellh added a commit that referenced this pull request Apr 20, 2015
providers/aws: check allocationId only if it's vpc, fixes #1345
@mitchellh mitchellh merged commit dda4ae6 into hashicorp:master Apr 20, 2015
@ghost
Copy link

ghost commented May 3, 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 May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants