File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ data "aws_iam_policy_document" "this" {
2929 for_each = each. value . statements
3030
3131 content {
32+ sid = statement. value . sid
3233 actions = statement. value . actions
3334 effect = statement. value . effect
3435 resources = statement. value . resources
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ variable "bucket_policies" {
3939 id = optional (string , null )
4040 version = optional (string , null )
4141 statements = optional (list (object ({
42+ sid = optional (string , null )
4243 actions = optional (set (string ), [])
4344 effect = optional (string , " Allow" )
4445 resources = optional (set (string ), [])
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ run "iam_policy_document_attributes_match" {
7878
7979 statements = [
8080 {
81+ sid = " example-sid"
8182 actions = [
8283 " s3:PutObject"
8384 ]
@@ -118,6 +119,11 @@ run "iam_policy_document_attributes_match" {
118119 error_message = " Statement count mismatch"
119120 }
120121
122+ assert {
123+ condition = data. aws_iam_policy_document . this [" example-policy" ]. statement [0 ]. sid == var. bucket_policies [" example-policy" ]. statements [0 ]. sid
124+ error_message = " Statement sid mismatch"
125+ }
126+
121127 assert {
122128 condition = data. aws_iam_policy_document . this [" example-policy" ]. statement [0 ]. actions == var. bucket_policies [" example-policy" ]. statements [0 ]. actions
123129 error_message = " Statement actions mismatch"
You can’t perform that action at this time.
0 commit comments