diff --git a/aws/resource_aws_network_acl_test.go b/aws/resource_aws_network_acl_test.go index 510488e2286..91f120ce6dc 100644 --- a/aws/resource_aws_network_acl_test.go +++ b/aws/resource_aws_network_acl_test.go @@ -275,6 +275,7 @@ func TestAccAWSNetworkAcl_OnlyEgressRules(t *testing.T) { } func TestAccAWSNetworkAcl_SubnetChange(t *testing.T) { + var networkAcl ec2.NetworkAcl resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -285,12 +286,14 @@ func TestAccAWSNetworkAcl_SubnetChange(t *testing.T) { { Config: testAccAWSNetworkAclSubnetConfig, Check: resource.ComposeTestCheckFunc( + testAccCheckAWSNetworkAclExists("aws_network_acl.bar", &networkAcl), testAccCheckSubnetIsAssociatedWithAcl("aws_network_acl.bar", "aws_subnet.old"), ), }, { Config: testAccAWSNetworkAclSubnetConfigChange, Check: resource.ComposeTestCheckFunc( + testAccCheckAWSNetworkAclExists("aws_network_acl.bar", &networkAcl), testAccCheckSubnetIsNotAssociatedWithAcl("aws_network_acl.bar", "aws_subnet.old"), testAccCheckSubnetIsAssociatedWithAcl("aws_network_acl.bar", "aws_subnet.new"), ), @@ -459,7 +462,7 @@ func testAccCheckAWSNetworkAclExists(n string, networkAcl *ec2.NetworkAcl) resou } if rs.Primary.ID == "" { - return fmt.Errorf("No Security Group is set") + return fmt.Errorf("No ID is set: %s", n) } conn := testAccProvider.Meta().(*AWSClient).ec2conn