Skip to content

Commit

Permalink
aws_config_config_rule: multiple evaluation modes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonaj committed Oct 20, 2023
1 parent 1d2df13 commit 6232737
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions internal/service/configservice/config_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ func testAccConfigRule_evaluationMode(t *testing.T) {
mode = "DETECTIVE"
}
`

evaluationMode2 := `
evaluation_mode {
mode = "DETECTIVE"
}
evaluation_mode {
mode = "PROACTIVE"
}
`
resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID),
Expand All @@ -77,17 +87,20 @@ func testAccConfigRule_evaluationMode(t *testing.T) {
}),
),
},
//{
// Config: testAccConfigRuleConfig_evaluationMode(rName, "PROACTIVE"),
// Check: resource.ComposeTestCheckFunc(
// testAccCheckConfigRuleExists(ctx, resourceName, &cr),
// testAccCheckConfigRuleName(resourceName, rName, &cr),
// resource.TestCheckResourceAttr(resourceName, "name", rName),
// resource.TestCheckTypeSetElemNestedAttrs(resourceName, "evaluation_mode.*", map[string]string{
// "mode": "PROACTIVE",
// }),
// ),
//},
{
Config: testAccConfigRuleConfig_evaluationMode(rName, evaluationMode2),
Check: resource.ComposeTestCheckFunc(
testAccCheckConfigRuleExists(ctx, resourceName, &cr),
testAccCheckConfigRuleName(resourceName, rName, &cr),
resource.TestCheckResourceAttr(resourceName, "name", rName),
resource.TestCheckTypeSetElemNestedAttrs(resourceName, "evaluation_mode.*", map[string]string{
"mode": "DETECTIVE",
}),
resource.TestCheckTypeSetElemNestedAttrs(resourceName, "evaluation_mode.*", map[string]string{
"mode": "PROACTIVE",
}),
),
},
},
})
}
Expand Down

0 comments on commit 6232737

Please sign in to comment.