Skip to content

Commit

Permalink
fix(logs): adding a resource policy statement with AnyPrincipal fails
Browse files Browse the repository at this point in the history
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
laurelmay committed Nov 26, 2023
1 parent b865320 commit b63ef98
Show file tree
Hide file tree
Showing 11 changed files with 487 additions and 2 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b63ef98

Please sign in to comment.