diff --git a/aws/resource_aws_config_config_rule_test.go b/aws/resource_aws_config_config_rule_test.go index d237df6affd5..f18ee4a4a975 100644 --- a/aws/resource_aws_config_config_rule_test.go +++ b/aws/resource_aws_config_config_rule_test.go @@ -98,7 +98,7 @@ func testAccConfigConfigRule_customlambda(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "source.0.owner", "CUSTOM_LAMBDA"), resource.TestCheckResourceAttrPair(resourceName, "source.0.source_identifier", "aws_lambda_function.f", "arn"), resource.TestCheckResourceAttr(resourceName, "source.0.source_detail.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "source.0.source_detail", map[string]string{ + tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "source.0.source_detail.*", map[string]string{ "event_source": "aws.config", "message_type": "ConfigurationSnapshotDeliveryCompleted", "maximum_execution_frequency": "", diff --git a/aws/resource_aws_config_organization_custom_rule_test.go b/aws/resource_aws_config_organization_custom_rule_test.go index 82ff3f0a890b..568ae55b23bc 100644 --- a/aws/resource_aws_config_organization_custom_rule_test.go +++ b/aws/resource_aws_config_organization_custom_rule_test.go @@ -4,9 +4,7 @@ import ( "fmt" "regexp" "testing" - "time" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/configservice" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -65,7 +63,7 @@ func testAccConfigOrganizationCustomRule_disappears(t *testing.T) { Config: testAccConfigOrganizationCustomRuleConfigTriggerTypes1(rName, "ConfigurationItemChangeNotification"), Check: resource.ComposeTestCheckFunc( testAccCheckConfigOrganizationCustomRuleExists(resourceName, &rule), - testAccCheckConfigOrganizationCustomRuleDisappears(&rule), + testAccCheckResourceDisappears(testAccProvider, resourceAwsConfigOrganizationCustomRule(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -475,24 +473,6 @@ func testAccCheckConfigOrganizationCustomRuleDestroy(s *terraform.State) error { return nil } -func testAccCheckConfigOrganizationCustomRuleDisappears(rule *configservice.OrganizationConfigRule) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).configconn - - input := &configservice.DeleteOrganizationConfigRuleInput{ - OrganizationConfigRuleName: rule.OrganizationConfigRuleName, - } - - _, err := conn.DeleteOrganizationConfigRule(input) - - if err != nil { - return err - } - - return configWaitForOrganizationRuleStatusDeleteSuccessful(conn, aws.StringValue(rule.OrganizationConfigRuleName), 5*time.Minute) - } -} - func testAccConfigOrganizationCustomRuleConfigBase(rName string) string { return fmt.Sprintf(` data "aws_partition" "current" { diff --git a/aws/resource_aws_config_organization_managed_rule_test.go b/aws/resource_aws_config_organization_managed_rule_test.go index 435111a4bd11..7c95d6446e45 100644 --- a/aws/resource_aws_config_organization_managed_rule_test.go +++ b/aws/resource_aws_config_organization_managed_rule_test.go @@ -4,9 +4,7 @@ import ( "fmt" "regexp" "testing" - "time" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/configservice" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -63,7 +61,7 @@ func testAccConfigOrganizationManagedRule_disappears(t *testing.T) { Config: testAccConfigOrganizationManagedRuleConfigRuleIdentifier(rName, "IAM_PASSWORD_POLICY"), Check: resource.ComposeTestCheckFunc( testAccCheckConfigOrganizationManagedRuleExists(resourceName, &rule), - testAccCheckConfigOrganizationManagedRuleDisappears(&rule), + testAccCheckResourceDisappears(testAccProvider, resourceAwsConfigOrganizationManagedRule(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -438,24 +436,6 @@ func testAccCheckConfigOrganizationManagedRuleDestroy(s *terraform.State) error return nil } -func testAccCheckConfigOrganizationManagedRuleDisappears(rule *configservice.OrganizationConfigRule) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).configconn - - input := &configservice.DeleteOrganizationConfigRuleInput{ - OrganizationConfigRuleName: rule.OrganizationConfigRuleName, - } - - _, err := conn.DeleteOrganizationConfigRule(input) - - if err != nil { - return err - } - - return configWaitForOrganizationRuleStatusDeleteSuccessful(conn, aws.StringValue(rule.OrganizationConfigRuleName), 5*time.Minute) - } -} - func testAccConfigOrganizationManagedRuleConfigBase(rName string) string { return fmt.Sprintf(` data "aws_partition" "current" {