-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(logs): adding a resource policy statement with
AnyPrincipal
fails
Because `AnyPrincipal` extends `ArnPrincipal` it gets caught up in the checks for parsing the ARN from the principal to get the account. This check should be skipped when the ARN is set to `"*"` because that can't be parsed.
- Loading branch information
Showing
11 changed files
with
487 additions
and
2 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...napshot/LogGroupResourcePolicyAnyPrincialIntegDefaultTestDeployAssert1A3C13F5.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...pshot/LogGroupResourcePolicyAnyPrincialIntegDefaultTestDeployAssert1A3C13F5.template.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...-policy-any-principal.js.snapshot/aws-cdk-log-group-resource-policy-any-integ.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
67 changes: 67 additions & 0 deletions
67
...olicy-any-principal.js.snapshot/aws-cdk-log-group-resource-policy-any-integ.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"Resources": { | ||
"LogGroupF5B46931": { | ||
"Type": "AWS::Logs::LogGroup", | ||
"Properties": { | ||
"RetentionInDays": 731 | ||
}, | ||
"UpdateReplacePolicy": "Retain", | ||
"DeletionPolicy": "Retain" | ||
}, | ||
"LogGroupPolicyResourcePolicy6FA18555": { | ||
"Type": "AWS::Logs::ResourcePolicy", | ||
"Properties": { | ||
"PolicyDocument": { | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"{\"Statement\":[{\"Action\":\"logs:PutLogEvents\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"*\"},\"Resource\":\"", | ||
{ | ||
"Fn::GetAtt": [ | ||
"LogGroupF5B46931", | ||
"Arn" | ||
] | ||
}, | ||
"\"}],\"Version\":\"2012-10-17\"}" | ||
] | ||
] | ||
}, | ||
"PolicyName": "awscdkloggroupresourcepolicyanyintegLogGroupPolicy69400813" | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...work-integ/test/aws-logs/test/integ.log-resource-policy-any-principal.js.snapshot/cdk.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...k-integ/test/aws-logs/test/integ.log-resource-policy-any-principal.js.snapshot/integ.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
119 changes: 119 additions & 0 deletions
119
...nteg/test/aws-logs/test/integ.log-resource-policy-any-principal.js.snapshot/manifest.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.