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

@ -30,9 +30,8 @@ func TestAccAWSEBSVolume_basic(t *testing.T) {
func TestAccAWSEBSVolume_NoIops(t *testing.T) { func TestAccAWSEBSVolume_NoIops(t *testing.T) {
var v ec2.Volume var v ec2.Volume
resource.Test(t, resource.TestCase{ resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) }, PreCheck: func() { testAccPreCheck(t) },
IDRefreshName: "aws_ebs_volume.iops_test", Providers: testAccProviders,
Providers: testAccProviders,
Steps: []resource.TestStep{ Steps: []resource.TestStep{
resource.TestStep{ resource.TestStep{
Config: testAccAwsEbsVolumeConfigWithNoIops, Config: testAccAwsEbsVolumeConfigWithNoIops,

View File

@ -158,6 +158,14 @@ func resourceAwsEipRead(d *schema.ResourceData, meta interface{}) error {
d.Set("private_ip", address.PrivateIpAddress) d.Set("private_ip", address.PrivateIpAddress)
d.Set("public_ip", address.PublicIp) 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 return nil
} }

View File

@ -16,9 +16,10 @@ func TestAccAWSEIP_basic(t *testing.T) {
var conf ec2.Address var conf ec2.Address
resource.Test(t, resource.TestCase{ resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) }, PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders, IDRefreshName: "aws_eip.bar",
CheckDestroy: testAccCheckAWSEIPDestroy, Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEIPDestroy,
Steps: []resource.TestStep{ Steps: []resource.TestStep{
resource.TestStep{ resource.TestStep{
Config: testAccAWSEIPConfig, Config: testAccAWSEIPConfig,
@ -35,9 +36,10 @@ func TestAccAWSEIP_instance(t *testing.T) {
var conf ec2.Address var conf ec2.Address
resource.Test(t, resource.TestCase{ resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) }, PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders, IDRefreshName: "aws_eip.bar",
CheckDestroy: testAccCheckAWSEIPDestroy, Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEIPDestroy,
Steps: []resource.TestStep{ Steps: []resource.TestStep{
resource.TestStep{ resource.TestStep{
Config: testAccAWSEIPInstanceConfig, Config: testAccAWSEIPInstanceConfig,
@ -62,9 +64,10 @@ func TestAccAWSEIP_network_interface(t *testing.T) {
var conf ec2.Address var conf ec2.Address
resource.Test(t, resource.TestCase{ resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) }, PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders, IDRefreshName: "aws_eip.bar",
CheckDestroy: testAccCheckAWSEIPDestroy, Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEIPDestroy,
Steps: []resource.TestStep{ Steps: []resource.TestStep{
resource.TestStep{ resource.TestStep{
Config: testAccAWSEIPNetworkInterfaceConfig, Config: testAccAWSEIPNetworkInterfaceConfig,
@ -82,9 +85,10 @@ func TestAccAWSEIP_twoEIPsOneNetworkInterface(t *testing.T) {
var one, two ec2.Address var one, two ec2.Address
resource.Test(t, resource.TestCase{ resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) }, PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders, IDRefreshName: "aws_eip.one",
CheckDestroy: testAccCheckAWSEIPDestroy, Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEIPDestroy,
Steps: []resource.TestStep{ Steps: []resource.TestStep{
resource.TestStep{ resource.TestStep{
Config: testAccAWSEIPMultiNetworkInterfaceConfig, Config: testAccAWSEIPMultiNetworkInterfaceConfig,