Merge pull request #1701 from hashicorp/b-cannot-retrieve-eip
provider/aws: fix EIPs on new upstream sdk
This commit is contained in:
commit
4140253578
|
@ -102,8 +102,8 @@ func resourceAwsEipRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
domain := resourceAwsEipDomain(d)
|
domain := resourceAwsEipDomain(d)
|
||||||
id := d.Id()
|
id := d.Id()
|
||||||
|
|
||||||
assocIds := []*string{}
|
var assocIds []*string
|
||||||
publicIps := []*string{}
|
var publicIps []*string
|
||||||
if domain == "vpc" {
|
if domain == "vpc" {
|
||||||
assocIds = []*string{aws.String(id)}
|
assocIds = []*string{aws.String(id)}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -66,8 +66,7 @@ func testAccCheckAWSEIPDestroy(s *terraform.State) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
req := &ec2.DescribeAddressesInput{
|
req := &ec2.DescribeAddressesInput{
|
||||||
AllocationIDs: []*string{},
|
PublicIPs: []*string{aws.String(rs.Primary.ID)},
|
||||||
PublicIPs: []*string{aws.String(rs.Primary.ID)},
|
|
||||||
}
|
}
|
||||||
describe, err := conn.DescribeAddresses(req)
|
describe, err := conn.DescribeAddresses(req)
|
||||||
|
|
||||||
|
@ -118,7 +117,6 @@ func testAccCheckAWSEIPExists(n string, res *ec2.Address) resource.TestCheckFunc
|
||||||
if strings.Contains(rs.Primary.ID, "eipalloc") {
|
if strings.Contains(rs.Primary.ID, "eipalloc") {
|
||||||
req := &ec2.DescribeAddressesInput{
|
req := &ec2.DescribeAddressesInput{
|
||||||
AllocationIDs: []*string{aws.String(rs.Primary.ID)},
|
AllocationIDs: []*string{aws.String(rs.Primary.ID)},
|
||||||
PublicIPs: []*string{},
|
|
||||||
}
|
}
|
||||||
describe, err := conn.DescribeAddresses(req)
|
describe, err := conn.DescribeAddresses(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -133,8 +131,7 @@ func testAccCheckAWSEIPExists(n string, res *ec2.Address) resource.TestCheckFunc
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
req := &ec2.DescribeAddressesInput{
|
req := &ec2.DescribeAddressesInput{
|
||||||
AllocationIDs: []*string{},
|
PublicIPs: []*string{aws.String(rs.Primary.ID)},
|
||||||
PublicIPs: []*string{aws.String(rs.Primary.ID)},
|
|
||||||
}
|
}
|
||||||
describe, err := conn.DescribeAddresses(req)
|
describe, err := conn.DescribeAddresses(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue