Skip to content

Commit

Permalink
disappears
Browse files Browse the repository at this point in the history
  • Loading branch information
DrFaust92 committed Sep 4, 2020
1 parent 06317c6 commit fe2feec
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions aws/resource_aws_cloudwatch_metric_alarm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func TestAccAWSCloudWatchMetricAlarm_disappears(t *testing.T) {
Config: testAccAWSCloudWatchMetricAlarmConfig(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm),
testAccCheckCloudWatchMetricAlarmDisappears(&alarm),
testAccCheckResourceDisappears(testAccProvider, resourceAwsCloudWatchMetricAlarm(), resourceName),
),
ExpectNonEmptyPlan: true,
},
Expand Down Expand Up @@ -420,24 +420,6 @@ func testAccCheckCloudWatchMetricAlarmExists(n string, alarm *cloudwatch.MetricA
}
}

func testAccCheckCloudWatchMetricAlarmDisappears(alarm *cloudwatch.MetricAlarm) resource.TestCheckFunc {
return func(s *terraform.State) error {
conn := testAccProvider.Meta().(*AWSClient).cloudwatchconn
params := &cloudwatch.DeleteAlarmsInput{
AlarmNames: []*string{alarm.AlarmName},
}
_, err := conn.DeleteAlarms(params)
if err != nil {
if isAWSErr(err, cloudwatch.ErrCodeResourceNotFoundException, "") {
return nil
}
return err
}

return nil
}
}

func testAccCheckAWSCloudWatchMetricAlarmDestroy(s *terraform.State) error {
conn := testAccProvider.Meta().(*AWSClient).cloudwatchconn

Expand Down

0 comments on commit fe2feec

Please sign in to comment.