providers/aws: eip id-only

This commit is contained in:
Mitchell Hashimoto 2016-04-21 22:17:14 -07:00
parent f394ce1ef3
commit c1509b0220
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
3 changed files with 26 additions and 15 deletions

View File

@ -31,7 +31,6 @@ func TestAccAWSEBSVolume_NoIops(t *testing.T) {
var v ec2.Volume
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
IDRefreshName: "aws_ebs_volume.iops_test",
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{

View File

@ -158,6 +158,14 @@ func resourceAwsEipRead(d *schema.ResourceData, meta interface{}) error {
d.Set("private_ip", address.PrivateIpAddress)
d.Set("public_ip", address.PublicIp)
// On import (domain never set, which it must've been if we created),
// set the 'vpc' attribute depending on if we're in a VPC.
if _, ok := d.GetOk("domain"); !ok {
d.Set("vpc", *address.Domain == "vpc")
}
d.Set("domain", address.Domain)
return nil
}

View File

@ -17,6 +17,7 @@ func TestAccAWSEIP_basic(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
IDRefreshName: "aws_eip.bar",
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEIPDestroy,
Steps: []resource.TestStep{
@ -36,6 +37,7 @@ func TestAccAWSEIP_instance(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
IDRefreshName: "aws_eip.bar",
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEIPDestroy,
Steps: []resource.TestStep{
@ -63,6 +65,7 @@ func TestAccAWSEIP_network_interface(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
IDRefreshName: "aws_eip.bar",
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEIPDestroy,
Steps: []resource.TestStep{
@ -83,6 +86,7 @@ func TestAccAWSEIP_twoEIPsOneNetworkInterface(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
IDRefreshName: "aws_eip.one",
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEIPDestroy,
Steps: []resource.TestStep{