Skip to content

Commit

Permalink
tests/provider: Fix hardcoded (Config Config Aggregator)
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Sep 9, 2020
1 parent bc480ff commit a8873a6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions aws/resource_aws_config_configuration_aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestAccAWSConfigConfigurationAggregator_account(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "account_aggregation_source.0.account_ids.#", "1"),
testAccCheckResourceAttrAccountID(resourceName, "account_aggregation_source.0.account_ids.0"),
resource.TestCheckResourceAttr(resourceName, "account_aggregation_source.0.regions.#", "1"),
resource.TestCheckResourceAttr(resourceName, "account_aggregation_source.0.regions.0", "us-west-2"),
resource.TestCheckResourceAttrPair(resourceName, "account_aggregation_source.0.regions.0", "data.aws_region.current", "name"),
),
},
{
Expand Down Expand Up @@ -261,12 +261,14 @@ func testAccCheckAWSConfigConfigurationAggregatorDestroy(s *terraform.State) err

func testAccAWSConfigConfigurationAggregatorConfig_account(rName string) string {
return fmt.Sprintf(`
data "aws_region" "current" {}
resource "aws_config_configuration_aggregator" "example" {
name = %[1]q
account_aggregation_source {
account_ids = [data.aws_caller_identity.current.account_id]
regions = ["us-west-2"]
regions = [data.aws_region.current.name]
}
}
Expand Down Expand Up @@ -320,12 +322,14 @@ resource "aws_iam_role_policy_attachment" "example" {

func testAccAWSConfigConfigurationAggregatorConfig_tags(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string {
return fmt.Sprintf(`
data "aws_region" "current" {}
resource "aws_config_configuration_aggregator" "example" {
name = %[1]q
account_aggregation_source {
account_ids = [data.aws_caller_identity.current.account_id]
regions = ["us-west-2"]
regions = [data.aws_region.current.name]
}
tags = {
Expand Down

0 comments on commit a8873a6

Please sign in to comment.