Skip to content

Commit 3f5b39f

Browse files
committed
chore(mixins-preview): integration test for Events
1 parent 529b3a7 commit 3f5b39f

26 files changed

+4698
-0
lines changed

packages/@aws-cdk/mixins-preview/test/services/aws-kms/integ.events.test.js.snapshot/KeyTestDefaultTestDeployAssert2D3BFAA3.assets.json

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

packages/@aws-cdk/mixins-preview/test/services/aws-kms/integ.events.test.js.snapshot/KeyTestDefaultTestDeployAssert2D3BFAA3.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.

packages/@aws-cdk/mixins-preview/test/services/aws-kms/integ.events.test.js.snapshot/L1L2KeyWithL2Rule.assets.json

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
{
2+
"Resources": {
3+
"KeyL1": {
4+
"Type": "AWS::KMS::Key"
5+
},
6+
"KeyL25E747C61": {
7+
"Type": "AWS::KMS::Key",
8+
"Properties": {
9+
"KeyPolicy": {
10+
"Statement": [
11+
{
12+
"Action": "kms:*",
13+
"Effect": "Allow",
14+
"Principal": {
15+
"AWS": {
16+
"Fn::Join": [
17+
"",
18+
[
19+
"arn:aws:iam::",
20+
{
21+
"Ref": "AWS::AccountId"
22+
},
23+
":root"
24+
]
25+
]
26+
}
27+
},
28+
"Resource": "*"
29+
}
30+
],
31+
"Version": "2012-10-17"
32+
}
33+
},
34+
"UpdateReplacePolicy": "Retain",
35+
"DeletionPolicy": "Retain"
36+
},
37+
"MyFuncAServiceRole9A674AAA": {
38+
"Type": "AWS::IAM::Role",
39+
"Properties": {
40+
"AssumeRolePolicyDocument": {
41+
"Statement": [
42+
{
43+
"Action": "sts:AssumeRole",
44+
"Effect": "Allow",
45+
"Principal": {
46+
"Service": "lambda.amazonaws.com"
47+
}
48+
}
49+
],
50+
"Version": "2012-10-17"
51+
},
52+
"ManagedPolicyArns": [
53+
{
54+
"Fn::Join": [
55+
"",
56+
[
57+
"arn:",
58+
{
59+
"Ref": "AWS::Partition"
60+
},
61+
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
62+
]
63+
]
64+
}
65+
]
66+
}
67+
},
68+
"MyFuncAAF5F3089": {
69+
"Type": "AWS::Lambda::Function",
70+
"Properties": {
71+
"Code": {
72+
"ZipFile": "\nexports.handler = async (event) => {\n console.log(\"New Project event:\", JSON.stringify(event, null, 2));\n return {};\n};\n"
73+
},
74+
"Handler": "index.handler",
75+
"Role": {
76+
"Fn::GetAtt": [
77+
"MyFuncAServiceRole9A674AAA",
78+
"Arn"
79+
]
80+
},
81+
"Runtime": "nodejs22.x"
82+
},
83+
"DependsOn": [
84+
"MyFuncAServiceRole9A674AAA"
85+
]
86+
},
87+
"MyFuncALogGroupD7C330A5": {
88+
"Type": "AWS::Logs::LogGroup",
89+
"Properties": {
90+
"LogGroupName": {
91+
"Fn::Join": [
92+
"",
93+
[
94+
"/aws/lambda/",
95+
{
96+
"Ref": "MyFuncAAF5F3089"
97+
}
98+
]
99+
]
100+
},
101+
"RetentionInDays": 731
102+
},
103+
"UpdateReplacePolicy": "Retain",
104+
"DeletionPolicy": "Retain"
105+
},
106+
"L2RuleForL13AA6354B": {
107+
"Type": "AWS::Events::Rule",
108+
"Properties": {
109+
"EventPattern": {
110+
"source": [
111+
"aws.kms"
112+
],
113+
"detail-type": [
114+
"AWS API Call via CloudTrail"
115+
],
116+
"detail": {
117+
"requestParameters": {
118+
"keyId": [
119+
{
120+
"Ref": "KeyL1"
121+
},
122+
{
123+
"Ref": "KeyL25E747C61"
124+
}
125+
]
126+
},
127+
"eventName": [
128+
"RotateKeyOnDemand"
129+
]
130+
}
131+
},
132+
"State": "ENABLED",
133+
"Targets": [
134+
{
135+
"Arn": {
136+
"Fn::GetAtt": [
137+
"MyFuncAAF5F3089",
138+
"Arn"
139+
]
140+
},
141+
"Id": "Target0"
142+
}
143+
]
144+
}
145+
},
146+
"L2RuleForL1AllowEventRuleL1L2KeyWithL2RuleMyFuncAA680479253AB68ED": {
147+
"Type": "AWS::Lambda::Permission",
148+
"Properties": {
149+
"Action": "lambda:InvokeFunction",
150+
"FunctionName": {
151+
"Fn::GetAtt": [
152+
"MyFuncAAF5F3089",
153+
"Arn"
154+
]
155+
},
156+
"Principal": "events.amazonaws.com",
157+
"SourceArn": {
158+
"Fn::GetAtt": [
159+
"L2RuleForL13AA6354B",
160+
"Arn"
161+
]
162+
}
163+
}
164+
}
165+
},
166+
"Parameters": {
167+
"BootstrapVersion": {
168+
"Type": "AWS::SSM::Parameter::Value<String>",
169+
"Default": "/cdk-bootstrap/hnb659fds/version",
170+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
171+
}
172+
},
173+
"Rules": {
174+
"CheckBootstrapVersion": {
175+
"Assertions": [
176+
{
177+
"Assert": {
178+
"Fn::Not": [
179+
{
180+
"Fn::Contains": [
181+
[
182+
"1",
183+
"2",
184+
"3",
185+
"4",
186+
"5"
187+
],
188+
{
189+
"Ref": "BootstrapVersion"
190+
}
191+
]
192+
}
193+
]
194+
},
195+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
196+
}
197+
]
198+
}
199+
}
200+
}

packages/@aws-cdk/mixins-preview/test/services/aws-kms/integ.events.test.js.snapshot/L2KeyOtherEventsWithL2Rule.assets.json

Lines changed: 21 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)