Skip to content

Commit

Permalink
fix no vpc test
Browse files Browse the repository at this point in the history
  • Loading branch information
DrFaust92 committed Sep 4, 2020
1 parent c05661c commit 4426673
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion aws/resource_aws_opsworks_custom_layer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,28 @@ func TestAccAWSOpsworksCustomLayer_cloudwatch(t *testing.T) {
})
}

func TestAccAWSOpsworksCustomLayer_disappears(t *testing.T) {
name := acctest.RandString(10)
var opslayer opsworks.Layer
resourceName := "aws_opsworks_custom_layer.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksCustomLayerDestroy,
Steps: []resource.TestStep{
{
Config: testAccAwsOpsworksCustomLayerConfigVpcCreate(name),
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSOpsworksLayerExists(resourceName, &opslayer),
testAccCheckResourceDisappears(testAccProvider, resourceAwsOpsworksCustomLayer(), resourceName),
),
ExpectNonEmptyPlan: true,
},
},
})
}

func testAccCheckAWSOpsworksLayerExists(n string, opslayer *opsworks.Layer) resource.TestCheckFunc {
return func(s *terraform.State) error {
rs, ok := s.RootModule().Resources[n]
Expand Down Expand Up @@ -388,7 +410,7 @@ resource "aws_opsworks_custom_layer" "test" {
auto_assign_public_ips = true
custom_security_group_ids = [
aws_security_group.tf-ops-acc-layer1.id,
aws_security_group.tf-ops-acc-layer2.id",
aws_security_group.tf-ops-acc-layer2.id,
]
drain_elb_on_shutdown = true
Expand Down

0 comments on commit 4426673

Please sign in to comment.