Skip to content

Commit

Permalink
Adds test to ensure invalid SIDs are allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Dec 19, 2024
1 parent db5d824 commit c9808a6
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions internal/service/iam/policy_document_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,21 @@ func TestAccIAMPolicyDocumentDataSource_overrideList(t *testing.T) {
})
}

func TestAccIAMPolicyDocumentDataSource_invalidSidValid(t *testing.T) {
ctx := acctest.Context(t)
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
Steps: []resource.TestStep{
{
Config: testAccPolicyDocumentDataSourceConfig_invalidSid,
PlanOnly: true,
},
},
})
}

func TestAccIAMPolicyDocumentDataSource_noStatementMerge(t *testing.T) {
ctx := acctest.Context(t)
resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -1022,6 +1037,18 @@ data "aws_iam_policy_document" "test_source_conflicting" {
}
`

var testAccPolicyDocumentDataSourceConfig_invalidSid = `
data "aws_iam_policy_document" "test" {
statement {
sid = "Invalid SID"
actions = [
"s3:ListAllMyBuckets",
"s3:GetBucketLocation",
]
}
}
`

var testAccPolicyDocumentSourceConflictingExpectedJSON = `{
"Version": "2012-10-17",
"Statement": [
Expand Down

0 comments on commit c9808a6

Please sign in to comment.