Skip to content

Commit c9808a6

Browse files
committed
Adds test to ensure invalid SIDs are allowed
1 parent db5d824 commit c9808a6

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

internal/service/iam/policy_document_data_source_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,21 @@ func TestAccIAMPolicyDocumentDataSource_overrideList(t *testing.T) {
236236
})
237237
}
238238

239+
func TestAccIAMPolicyDocumentDataSource_invalidSidValid(t *testing.T) {
240+
ctx := acctest.Context(t)
241+
resource.ParallelTest(t, resource.TestCase{
242+
PreCheck: func() { acctest.PreCheck(ctx, t) },
243+
ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID),
244+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
245+
Steps: []resource.TestStep{
246+
{
247+
Config: testAccPolicyDocumentDataSourceConfig_invalidSid,
248+
PlanOnly: true,
249+
},
250+
},
251+
})
252+
}
253+
239254
func TestAccIAMPolicyDocumentDataSource_noStatementMerge(t *testing.T) {
240255
ctx := acctest.Context(t)
241256
resource.ParallelTest(t, resource.TestCase{
@@ -1022,6 +1037,18 @@ data "aws_iam_policy_document" "test_source_conflicting" {
10221037
}
10231038
`
10241039

1040+
var testAccPolicyDocumentDataSourceConfig_invalidSid = `
1041+
data "aws_iam_policy_document" "test" {
1042+
statement {
1043+
sid = "Invalid SID"
1044+
actions = [
1045+
"s3:ListAllMyBuckets",
1046+
"s3:GetBucketLocation",
1047+
]
1048+
}
1049+
}
1050+
`
1051+
10251052
var testAccPolicyDocumentSourceConflictingExpectedJSON = `{
10261053
"Version": "2012-10-17",
10271054
"Statement": [

0 commit comments

Comments
 (0)