Skip to content

Commit 0e95bf0

Browse files
authored
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*
1 parent c5eca1a commit 0e95bf0

13 files changed

+838
-4
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-logs/test/integ.subscriptionfilter-distribution.js.snapshot/aws-cdk-subscriptionfilter-distribution-integ.assets.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
{
2+
"Resources": {
3+
"LogGroupF5B46931": {
4+
"Type": "AWS::Logs::LogGroup",
5+
"Properties": {
6+
"RetentionInDays": 731
7+
},
8+
"UpdateReplacePolicy": "Retain",
9+
"DeletionPolicy": "Retain"
10+
},
11+
"LogGroupSubscriptionCloudWatchLogsCanPutRecords29011851": {
12+
"Type": "AWS::IAM::Role",
13+
"Properties": {
14+
"AssumeRolePolicyDocument": {
15+
"Statement": [
16+
{
17+
"Action": "sts:AssumeRole",
18+
"Effect": "Allow",
19+
"Principal": {
20+
"Service": "logs.amazonaws.com"
21+
}
22+
}
23+
],
24+
"Version": "2012-10-17"
25+
}
26+
}
27+
},
28+
"LogGroupSubscriptionCloudWatchLogsCanPutRecordsDefaultPolicyB7125314": {
29+
"Type": "AWS::IAM::Policy",
30+
"Properties": {
31+
"PolicyDocument": {
32+
"Statement": [
33+
{
34+
"Action": [
35+
"kinesis:ListShards",
36+
"kinesis:PutRecord",
37+
"kinesis:PutRecords"
38+
],
39+
"Effect": "Allow",
40+
"Resource": {
41+
"Fn::GetAtt": [
42+
"Stream790BDEE4",
43+
"Arn"
44+
]
45+
}
46+
},
47+
{
48+
"Action": "iam:PassRole",
49+
"Effect": "Allow",
50+
"Resource": {
51+
"Fn::GetAtt": [
52+
"LogGroupSubscriptionCloudWatchLogsCanPutRecords29011851",
53+
"Arn"
54+
]
55+
}
56+
}
57+
],
58+
"Version": "2012-10-17"
59+
},
60+
"PolicyName": "LogGroupSubscriptionCloudWatchLogsCanPutRecordsDefaultPolicyB7125314",
61+
"Roles": [
62+
{
63+
"Ref": "LogGroupSubscriptionCloudWatchLogsCanPutRecords29011851"
64+
}
65+
]
66+
}
67+
},
68+
"LogGroupSubscriptionE3573E29": {
69+
"Type": "AWS::Logs::SubscriptionFilter",
70+
"Properties": {
71+
"DestinationArn": {
72+
"Fn::GetAtt": [
73+
"Stream790BDEE4",
74+
"Arn"
75+
]
76+
},
77+
"Distribution": "Random",
78+
"FilterName": "CustomSubscriptionFilterName",
79+
"FilterPattern": "\"ERROR\" \"MainThread\"",
80+
"LogGroupName": {
81+
"Ref": "LogGroupF5B46931"
82+
},
83+
"RoleArn": {
84+
"Fn::GetAtt": [
85+
"LogGroupSubscriptionCloudWatchLogsCanPutRecords29011851",
86+
"Arn"
87+
]
88+
}
89+
},
90+
"DependsOn": [
91+
"LogGroupSubscriptionCloudWatchLogsCanPutRecordsDefaultPolicyB7125314"
92+
]
93+
},
94+
"Stream790BDEE4": {
95+
"Type": "AWS::Kinesis::Stream",
96+
"Properties": {
97+
"RetentionPeriodHours": 24,
98+
"ShardCount": 1,
99+
"StreamEncryption": {
100+
"Fn::If": [
101+
"AwsCdkKinesisEncryptedStreamsUnsupportedRegions",
102+
{
103+
"Ref": "AWS::NoValue"
104+
},
105+
{
106+
"EncryptionType": "KMS",
107+
"KeyId": "alias/aws/kinesis"
108+
}
109+
]
110+
}
111+
},
112+
"UpdateReplacePolicy": "Retain",
113+
"DeletionPolicy": "Retain"
114+
}
115+
},
116+
"Conditions": {
117+
"AwsCdkKinesisEncryptedStreamsUnsupportedRegions": {
118+
"Fn::Or": [
119+
{
120+
"Fn::Equals": [
121+
{
122+
"Ref": "AWS::Region"
123+
},
124+
"cn-north-1"
125+
]
126+
},
127+
{
128+
"Fn::Equals": [
129+
{
130+
"Ref": "AWS::Region"
131+
},
132+
"cn-northwest-1"
133+
]
134+
}
135+
]
136+
}
137+
},
138+
"Parameters": {
139+
"BootstrapVersion": {
140+
"Type": "AWS::SSM::Parameter::Value<String>",
141+
"Default": "/cdk-bootstrap/hnb659fds/version",
142+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
143+
}
144+
},
145+
"Rules": {
146+
"CheckBootstrapVersion": {
147+
"Assertions": [
148+
{
149+
"Assert": {
150+
"Fn::Not": [
151+
{
152+
"Fn::Contains": [
153+
[
154+
"1",
155+
"2",
156+
"3",
157+
"4",
158+
"5"
159+
],
160+
{
161+
"Ref": "BootstrapVersion"
162+
}
163+
]
164+
}
165+
]
166+
},
167+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
168+
}
169+
]
170+
}
171+
}
172+
}

packages/@aws-cdk-testing/framework-integ/test/aws-logs/test/integ.subscriptionfilter-distribution.js.snapshot/cdk.out

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-logs/test/integ.subscriptionfilter-distribution.js.snapshot/integ.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-logs/test/integ.subscriptionfilter-distribution.js.snapshot/integtestDefaultTestDeployAssert24D5C536.assets.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-logs/test/integ.subscriptionfilter-distribution.js.snapshot/integtestDefaultTestDeployAssert24D5C536.template.json

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)