Skip to content

Commit a75e578

Browse files
authored
Revert "add validation for iam policy document sid"
1 parent 7442289 commit a75e578

File tree

3 files changed

+2
-34
lines changed

3 files changed

+2
-34
lines changed

.changelog/40562.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

internal/service/iam/policy_document_data_source.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"strconv"
1212
"strings"
1313

14-
"github.com/YakDriver/regexache"
1514
"github.com/aws/aws-sdk-go-v2/aws"
1615
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1716
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@@ -144,9 +143,8 @@ func dataSourcePolicyDocument() *schema.Resource {
144143
"principals": principalsSchema(),
145144
names.AttrResources: setOfStringSchema(),
146145
"sid": {
147-
Type: schema.TypeString,
148-
Optional: true,
149-
ValidateFunc: validation.StringMatch(regexache.MustCompile(`^[a-zA-Z0-9]*$`), "must only include alphanumeric characters"),
146+
Type: schema.TypeString,
147+
Optional: true,
150148
},
151149
},
152150
},

internal/service/iam/policy_document_data_source_test.go

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

239-
func TestAccIAMPolicyDocumentDataSource_validateSid(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-
ExpectError: regexache.MustCompile(`must only include alphanumeric characters`),
249-
},
250-
},
251-
})
252-
}
253-
254239
func TestAccIAMPolicyDocumentDataSource_noStatementMerge(t *testing.T) {
255240
ctx := acctest.Context(t)
256241
resource.ParallelTest(t, resource.TestCase{
@@ -1037,18 +1022,6 @@ data "aws_iam_policy_document" "test_source_conflicting" {
10371022
}
10381023
`
10391024

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-
10521025
var testAccPolicyDocumentSourceConflictingExpectedJSON = `{
10531026
"Version": "2012-10-17",
10541027
"Statement": [

0 commit comments

Comments
 (0)