Skip to content

Commit

Permalink
feat(logs): add distribution property to the Subscription class (#30423)
Browse files Browse the repository at this point in the history
### 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
mazyu36 committed Jun 3, 2024
1 parent c5eca1a commit 0e95bf0
Show file tree
Hide file tree
Showing 13 changed files with 838 additions and 4 deletions.

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

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.

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

Loading

0 comments on commit 0e95bf0

Please sign in to comment.