-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(logs): add distribution property to the Subscription class (#30423)
### Issue # (if applicable) Closes #30422 ### Reason for this change Missing Property in the Subscription class. ### Description of changes Add destination property to the Subscription class. ### Description of how you validated changes Add unit tests and integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
13 changed files
with
838 additions
and
4 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...filter-distribution.js.snapshot/aws-cdk-subscriptionfilter-distribution-integ.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
172 changes: 172 additions & 0 deletions
172
...lter-distribution.js.snapshot/aws-cdk-subscriptionfilter-distribution-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,172 @@ | ||
{ | ||
"Resources": { | ||
"LogGroupF5B46931": { | ||
"Type": "AWS::Logs::LogGroup", | ||
"Properties": { | ||
"RetentionInDays": 731 | ||
}, | ||
"UpdateReplacePolicy": "Retain", | ||
"DeletionPolicy": "Retain" | ||
}, | ||
"LogGroupSubscriptionCloudWatchLogsCanPutRecords29011851": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "logs.amazonaws.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} | ||
} | ||
}, | ||
"LogGroupSubscriptionCloudWatchLogsCanPutRecordsDefaultPolicyB7125314": { | ||
"Type": "AWS::IAM::Policy", | ||
"Properties": { | ||
"PolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"kinesis:ListShards", | ||
"kinesis:PutRecord", | ||
"kinesis:PutRecords" | ||
], | ||
"Effect": "Allow", | ||
"Resource": { | ||
"Fn::GetAtt": [ | ||
"Stream790BDEE4", | ||
"Arn" | ||
] | ||
} | ||
}, | ||
{ | ||
"Action": "iam:PassRole", | ||
"Effect": "Allow", | ||
"Resource": { | ||
"Fn::GetAtt": [ | ||
"LogGroupSubscriptionCloudWatchLogsCanPutRecords29011851", | ||
"Arn" | ||
] | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"PolicyName": "LogGroupSubscriptionCloudWatchLogsCanPutRecordsDefaultPolicyB7125314", | ||
"Roles": [ | ||
{ | ||
"Ref": "LogGroupSubscriptionCloudWatchLogsCanPutRecords29011851" | ||
} | ||
] | ||
} | ||
}, | ||
"LogGroupSubscriptionE3573E29": { | ||
"Type": "AWS::Logs::SubscriptionFilter", | ||
"Properties": { | ||
"DestinationArn": { | ||
"Fn::GetAtt": [ | ||
"Stream790BDEE4", | ||
"Arn" | ||
] | ||
}, | ||
"Distribution": "Random", | ||
"FilterName": "CustomSubscriptionFilterName", | ||
"FilterPattern": "\"ERROR\" \"MainThread\"", | ||
"LogGroupName": { | ||
"Ref": "LogGroupF5B46931" | ||
}, | ||
"RoleArn": { | ||
"Fn::GetAtt": [ | ||
"LogGroupSubscriptionCloudWatchLogsCanPutRecords29011851", | ||
"Arn" | ||
] | ||
} | ||
}, | ||
"DependsOn": [ | ||
"LogGroupSubscriptionCloudWatchLogsCanPutRecordsDefaultPolicyB7125314" | ||
] | ||
}, | ||
"Stream790BDEE4": { | ||
"Type": "AWS::Kinesis::Stream", | ||
"Properties": { | ||
"RetentionPeriodHours": 24, | ||
"ShardCount": 1, | ||
"StreamEncryption": { | ||
"Fn::If": [ | ||
"AwsCdkKinesisEncryptedStreamsUnsupportedRegions", | ||
{ | ||
"Ref": "AWS::NoValue" | ||
}, | ||
{ | ||
"EncryptionType": "KMS", | ||
"KeyId": "alias/aws/kinesis" | ||
} | ||
] | ||
} | ||
}, | ||
"UpdateReplacePolicy": "Retain", | ||
"DeletionPolicy": "Retain" | ||
} | ||
}, | ||
"Conditions": { | ||
"AwsCdkKinesisEncryptedStreamsUnsupportedRegions": { | ||
"Fn::Or": [ | ||
{ | ||
"Fn::Equals": [ | ||
{ | ||
"Ref": "AWS::Region" | ||
}, | ||
"cn-north-1" | ||
] | ||
}, | ||
{ | ||
"Fn::Equals": [ | ||
{ | ||
"Ref": "AWS::Region" | ||
}, | ||
"cn-northwest-1" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"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
...mework-integ/test/aws-logs/test/integ.subscriptionfilter-distribution.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
...ork-integ/test/aws-logs/test/integ.subscriptionfilter-distribution.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.
19 changes: 19 additions & 0 deletions
19
...ptionfilter-distribution.js.snapshot/integtestDefaultTestDeployAssert24D5C536.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
...ionfilter-distribution.js.snapshot/integtestDefaultTestDeployAssert24D5C536.template.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.