skuba 9.0.0-renovate-eslint-9.x-20240811034714 → 9.0.0-renovate-eslint-9.x-20240923103202

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/lib/api/buildkite/annotate.d.ts +2 -0
  2. package/lib/api/buildkite/annotate.js +14 -1
  3. package/lib/api/buildkite/annotate.js.map +2 -2
  4. package/lib/cli/adapter/eslint.js +12 -6
  5. package/lib/cli/adapter/eslint.js.map +2 -2
  6. package/lib/cli/build/index.js +1 -0
  7. package/lib/cli/build/index.js.map +1 -1
  8. package/lib/cli/configure/analyseDependencies.js +0 -2
  9. package/lib/cli/configure/analyseDependencies.js.map +2 -2
  10. package/lib/cli/configure/analysis/package.d.ts +1 -2
  11. package/lib/cli/configure/analysis/package.js +0 -27
  12. package/lib/cli/configure/analysis/package.js.map +2 -2
  13. package/lib/cli/configure/dependencies/skubaDeps.js +4 -3
  14. package/lib/cli/configure/dependencies/skubaDeps.js.map +2 -2
  15. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +9 -19
  16. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +3 -3
  17. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +5 -0
  18. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +2 -2
  19. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.d.ts +2 -0
  20. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +99 -0
  21. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +7 -0
  22. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +69 -23
  23. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +3 -3
  24. package/lib/cli/node.d.ts +2 -1
  25. package/lib/cli/node.js +23 -18
  26. package/lib/cli/node.js.map +3 -3
  27. package/lib/cli/start.js +3 -3
  28. package/lib/cli/start.js.map +2 -2
  29. package/lib/eslint.d.js +2 -0
  30. package/lib/utils/template.d.ts +4 -4
  31. package/package.json +11 -10
  32. package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
  33. package/template/express-rest-api/Dockerfile.dev-deps +1 -1
  34. package/template/express-rest-api/package.json +2 -2
  35. package/template/greeter/.buildkite/pipeline.yml +1 -1
  36. package/template/greeter/Dockerfile +1 -1
  37. package/template/greeter/package.json +2 -2
  38. package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
  39. package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
  40. package/template/koa-rest-api/package.json +6 -6
  41. package/template/koa-rest-api/src/framework/server.ts +3 -5
  42. package/template/lambda-sqs-worker/.buildkite/pipeline.yml +2 -2
  43. package/template/lambda-sqs-worker/Dockerfile +1 -1
  44. package/template/lambda-sqs-worker/package.json +2 -2
  45. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
  46. package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
  47. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +447 -891
  48. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +4 -1
  49. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +5 -84
  50. package/template/lambda-sqs-worker-cdk/infra/config.ts +1 -1
  51. package/template/lambda-sqs-worker-cdk/infra/index.ts +20 -3
  52. package/template/lambda-sqs-worker-cdk/package.json +4 -3
  53. package/template/oss-npm-package/.github/workflows/release.yml +1 -1
  54. package/template/oss-npm-package/_package.json +1 -1
  55. package/template/private-npm-package/_package.json +1 -1
  56. package/lib/why-is-node-running.d.js +0 -2
  57. package/template/lambda-sqs-worker-cdk/src/postHook.ts +0 -154
  58. package/template/lambda-sqs-worker-cdk/src/preHook.ts +0 -95
  59. /package/lib/{why-is-node-running.d.js.map → eslint.d.js.map} +0 -0
@@ -10,181 +10,6 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
10
10
  },
11
11
  },
12
12
  "Resources": {
13
- "codedeployalarm9F48D05F": {
14
- "Properties": {
15
- "ComparisonOperator": "GreaterThanOrEqualToThreshold",
16
- "Dimensions": [
17
- {
18
- "Name": "FunctionName",
19
- "Value": {
20
- "Ref": "worker28EA3E30",
21
- },
22
- },
23
- {
24
- "Name": "Resource",
25
- "Value": {
26
- "Fn::Join": [
27
- "",
28
- [
29
- {
30
- "Ref": "worker28EA3E30",
31
- },
32
- ":live",
33
- ],
34
- ],
35
- },
36
- },
37
- ],
38
- "EvaluationPeriods": 1,
39
- "MetricName": "Errors",
40
- "Namespace": "AWS/Lambda",
41
- "Period": 60,
42
- "Statistic": "Sum",
43
- "Threshold": 1,
44
- },
45
- "Type": "AWS::CloudWatch::Alarm",
46
- },
47
- "codedeployapplicationF49B9864": {
48
- "Properties": {
49
- "ComputePlatform": "Lambda",
50
- },
51
- "Type": "AWS::CodeDeploy::Application",
52
- },
53
- "codedeploygroup441B094B": {
54
- "Properties": {
55
- "AlarmConfiguration": {
56
- "Alarms": [
57
- {
58
- "Name": {
59
- "Ref": "codedeployalarm9F48D05F",
60
- },
61
- },
62
- ],
63
- "Enabled": true,
64
- },
65
- "ApplicationName": {
66
- "Ref": "codedeployapplicationF49B9864",
67
- },
68
- "AutoRollbackConfiguration": {
69
- "Enabled": true,
70
- "Events": [
71
- "DEPLOYMENT_FAILURE",
72
- "DEPLOYMENT_STOP_ON_ALARM",
73
- ],
74
- },
75
- "DeploymentConfigName": "CodeDeployDefault.LambdaAllAtOnce",
76
- "DeploymentStyle": {
77
- "DeploymentOption": "WITH_TRAFFIC_CONTROL",
78
- "DeploymentType": "BLUE_GREEN",
79
- },
80
- "ServiceRoleArn": {
81
- "Fn::GetAtt": [
82
- "codedeploygroupServiceRole1BD49E37",
83
- "Arn",
84
- ],
85
- },
86
- },
87
- "Type": "AWS::CodeDeploy::DeploymentGroup",
88
- },
89
- "codedeploygroupServiceRole1BD49E37": {
90
- "Properties": {
91
- "AssumeRolePolicyDocument": {
92
- "Statement": [
93
- {
94
- "Action": "sts:AssumeRole",
95
- "Effect": "Allow",
96
- "Principal": {
97
- "Service": "codedeploy.amazonaws.com",
98
- },
99
- },
100
- ],
101
- "Version": "2012-10-17",
102
- },
103
- "ManagedPolicyArns": [
104
- {
105
- "Fn::Join": [
106
- "",
107
- [
108
- "arn:",
109
- {
110
- "Ref": "AWS::Partition",
111
- },
112
- ":iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
113
- ],
114
- ],
115
- },
116
- ],
117
- },
118
- "Type": "AWS::IAM::Role",
119
- },
120
- "codedeploygroupServiceRoleDefaultPolicy2027BC9A": {
121
- "Properties": {
122
- "PolicyDocument": {
123
- "Statement": [
124
- {
125
- "Action": "lambda:InvokeFunction",
126
- "Effect": "Allow",
127
- "Resource": [
128
- {
129
- "Fn::GetAtt": [
130
- "workerprehook415B13CE",
131
- "Arn",
132
- ],
133
- },
134
- {
135
- "Fn::Join": [
136
- "",
137
- [
138
- {
139
- "Fn::GetAtt": [
140
- "workerprehook415B13CE",
141
- "Arn",
142
- ],
143
- },
144
- ":*",
145
- ],
146
- ],
147
- },
148
- ],
149
- },
150
- {
151
- "Action": "lambda:InvokeFunction",
152
- "Effect": "Allow",
153
- "Resource": [
154
- {
155
- "Fn::GetAtt": [
156
- "workerposthook150842D6",
157
- "Arn",
158
- ],
159
- },
160
- {
161
- "Fn::Join": [
162
- "",
163
- [
164
- {
165
- "Fn::GetAtt": [
166
- "workerposthook150842D6",
167
- "Arn",
168
- ],
169
- },
170
- ":*",
171
- ],
172
- ],
173
- },
174
- ],
175
- },
176
- ],
177
- "Version": "2012-10-17",
178
- },
179
- "PolicyName": "codedeploygroupServiceRoleDefaultPolicy2027BC9A",
180
- "Roles": [
181
- {
182
- "Ref": "codedeploygroupServiceRole1BD49E37",
183
- },
184
- ],
185
- },
186
- "Type": "AWS::IAM::Policy",
187
- },
188
13
  "kmskey49FBC3B3": {
189
14
  "DeletionPolicy": "Retain",
190
15
  "Properties": {
@@ -354,11 +179,17 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
354
179
  ],
355
180
  },
356
181
  "Runtime": "nodejs20.x",
182
+ "Tags": [
183
+ {
184
+ "Key": "aws-codedeploy-hooks",
185
+ "Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
186
+ },
187
+ ],
357
188
  "Timeout": 30,
358
189
  },
359
190
  "Type": "AWS::Lambda::Function",
360
191
  },
361
- "workerAliaslive62FE5FAF": {
192
+ "workerAliasLive4B82F015": {
362
193
  "Properties": {
363
194
  "Description": "The Lambda version currently receiving traffic",
364
195
  "FunctionName": {
@@ -370,27 +201,81 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
370
201
  "Version",
371
202
  ],
372
203
  },
373
- "Name": "live",
204
+ "Name": "Live",
374
205
  },
375
206
  "Type": "AWS::Lambda::Alias",
376
207
  "UpdatePolicy": {
377
208
  "CodeDeployLambdaAliasUpdate": {
378
209
  "AfterAllowTrafficHook": {
379
- "Ref": "workerposthook150842D6",
210
+ "Fn::Select": [
211
+ 6,
212
+ {
213
+ "Fn::Split": [
214
+ ":",
215
+ {
216
+ "Fn::Join": [
217
+ "",
218
+ [
219
+ "arn:",
220
+ {
221
+ "Ref": "AWS::Partition",
222
+ },
223
+ ":lambda:",
224
+ {
225
+ "Ref": "AWS::Region",
226
+ },
227
+ ":",
228
+ {
229
+ "Ref": "AWS::AccountId",
230
+ },
231
+ ":function:aws-codedeploy-hook-AfterAllowTraffic",
232
+ ],
233
+ ],
234
+ },
235
+ ],
236
+ },
237
+ ],
380
238
  },
381
239
  "ApplicationName": {
382
- "Ref": "codedeployapplicationF49B9864",
240
+ "Ref": "workerDeploymentCodeDeployLambdaApplication9974008D",
383
241
  },
384
242
  "BeforeAllowTrafficHook": {
385
- "Ref": "workerprehook415B13CE",
243
+ "Fn::Select": [
244
+ 6,
245
+ {
246
+ "Fn::Split": [
247
+ ":",
248
+ {
249
+ "Fn::Join": [
250
+ "",
251
+ [
252
+ "arn:",
253
+ {
254
+ "Ref": "AWS::Partition",
255
+ },
256
+ ":lambda:",
257
+ {
258
+ "Ref": "AWS::Region",
259
+ },
260
+ ":",
261
+ {
262
+ "Ref": "AWS::AccountId",
263
+ },
264
+ ":function:aws-codedeploy-hook-BeforeAllowTraffic",
265
+ ],
266
+ ],
267
+ },
268
+ ],
269
+ },
270
+ ],
386
271
  },
387
272
  "DeploymentGroupName": {
388
- "Ref": "codedeploygroup441B094B",
273
+ "Ref": "workerDeploymentCodeDeployLambdaDeploymentGroupF884ECDA",
389
274
  },
390
275
  },
391
276
  },
392
277
  },
393
- "workerAliasliveSqsEventSourceappStackworkerqueue8281B9F42DEDB47B": {
278
+ "workerAliasLiveSqsEventSourceappStackworkerqueue8281B9F443B0CF93": {
394
279
  "Properties": {
395
280
  "EventSourceArn": {
396
281
  "Fn::GetAtt": [
@@ -409,19 +294,22 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
409
294
  "Fn::Split": [
410
295
  ":",
411
296
  {
412
- "Ref": "workerAliaslive62FE5FAF",
297
+ "Ref": "workerAliasLive4B82F015",
413
298
  },
414
299
  ],
415
300
  },
416
301
  ],
417
302
  },
418
- ":live",
303
+ ":Live",
419
304
  ],
420
305
  ],
421
306
  },
422
- "ScalingConfig": {
423
- "MaximumConcurrency": 2,
424
- },
307
+ "Tags": [
308
+ {
309
+ "Key": "aws-codedeploy-hooks",
310
+ "Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
311
+ },
312
+ ],
425
313
  },
426
314
  "Type": "AWS::Lambda::EventSourceMapping",
427
315
  },
@@ -433,7 +321,50 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
433
321
  },
434
322
  "Type": "AWS::Lambda::Version",
435
323
  },
436
- "workerServiceRole2130CC7F": {
324
+ "workerDeploymentCodeDeployLambdaApplication9974008D": {
325
+ "Properties": {
326
+ "ComputePlatform": "Lambda",
327
+ "Tags": [
328
+ {
329
+ "Key": "aws-codedeploy-hooks",
330
+ "Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
331
+ },
332
+ ],
333
+ },
334
+ "Type": "AWS::CodeDeploy::Application",
335
+ },
336
+ "workerDeploymentCodeDeployLambdaDeploymentGroupF884ECDA": {
337
+ "Properties": {
338
+ "ApplicationName": {
339
+ "Ref": "workerDeploymentCodeDeployLambdaApplication9974008D",
340
+ },
341
+ "AutoRollbackConfiguration": {
342
+ "Enabled": true,
343
+ "Events": [
344
+ "DEPLOYMENT_FAILURE",
345
+ ],
346
+ },
347
+ "DeploymentConfigName": "CodeDeployDefault.LambdaAllAtOnce",
348
+ "DeploymentStyle": {
349
+ "DeploymentOption": "WITH_TRAFFIC_CONTROL",
350
+ "DeploymentType": "BLUE_GREEN",
351
+ },
352
+ "ServiceRoleArn": {
353
+ "Fn::GetAtt": [
354
+ "workerDeploymentCodeDeployLambdaDeploymentGroupServiceRole351C6FAE",
355
+ "Arn",
356
+ ],
357
+ },
358
+ "Tags": [
359
+ {
360
+ "Key": "aws-codedeploy-hooks",
361
+ "Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
362
+ },
363
+ ],
364
+ },
365
+ "Type": "AWS::CodeDeploy::DeploymentGroup",
366
+ },
367
+ "workerDeploymentCodeDeployLambdaDeploymentGroupServiceRole351C6FAE": {
437
368
  "Properties": {
438
369
  "AssumeRolePolicyDocument": {
439
370
  "Statement": [
@@ -441,7 +372,7 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
441
372
  "Action": "sts:AssumeRole",
442
373
  "Effect": "Allow",
443
374
  "Principal": {
444
- "Service": "lambda.amazonaws.com",
375
+ "Service": "codedeploy.amazonaws.com",
445
376
  },
446
377
  },
447
378
  ],
@@ -456,257 +387,129 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
456
387
  {
457
388
  "Ref": "AWS::Partition",
458
389
  },
459
- ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
390
+ ":iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
460
391
  ],
461
392
  ],
462
393
  },
463
394
  ],
395
+ "Tags": [
396
+ {
397
+ "Key": "aws-codedeploy-hooks",
398
+ "Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
399
+ },
400
+ ],
464
401
  },
465
402
  "Type": "AWS::IAM::Role",
466
403
  },
467
- "workerServiceRoleDefaultPolicyBA498553": {
404
+ "workerDeploymentCodeDeployLambdaDeploymentGroupServiceRoleDefaultPolicy30B750B5": {
468
405
  "Properties": {
469
406
  "PolicyDocument": {
470
407
  "Statement": [
471
408
  {
472
- "Action": [
473
- "sqs:ReceiveMessage",
474
- "sqs:ChangeMessageVisibility",
475
- "sqs:GetQueueUrl",
476
- "sqs:DeleteMessage",
477
- "sqs:GetQueueAttributes",
478
- ],
409
+ "Action": "lambda:InvokeFunction",
479
410
  "Effect": "Allow",
480
- "Resource": {
481
- "Fn::GetAtt": [
482
- "workerqueueA05CE5C6",
483
- "Arn",
484
- ],
485
- },
411
+ "Resource": [
412
+ {
413
+ "Fn::Join": [
414
+ "",
415
+ [
416
+ "arn:",
417
+ {
418
+ "Ref": "AWS::Partition",
419
+ },
420
+ ":lambda:",
421
+ {
422
+ "Ref": "AWS::Region",
423
+ },
424
+ ":",
425
+ {
426
+ "Ref": "AWS::AccountId",
427
+ },
428
+ ":function:aws-codedeploy-hook-BeforeAllowTraffic",
429
+ ],
430
+ ],
431
+ },
432
+ {
433
+ "Fn::Join": [
434
+ "",
435
+ [
436
+ "arn:",
437
+ {
438
+ "Ref": "AWS::Partition",
439
+ },
440
+ ":lambda:",
441
+ {
442
+ "Ref": "AWS::Region",
443
+ },
444
+ ":",
445
+ {
446
+ "Ref": "AWS::AccountId",
447
+ },
448
+ ":function:aws-codedeploy-hook-BeforeAllowTraffic:*",
449
+ ],
450
+ ],
451
+ },
452
+ ],
486
453
  },
487
454
  {
488
- "Action": "kms:Decrypt",
489
- "Effect": "Allow",
490
- "Resource": {
491
- "Fn::GetAtt": [
492
- "kmskey49FBC3B3",
493
- "Arn",
494
- ],
495
- },
496
- },
497
- ],
498
- "Version": "2012-10-17",
499
- },
500
- "PolicyName": "workerServiceRoleDefaultPolicyBA498553",
501
- "Roles": [
502
- {
503
- "Ref": "workerServiceRole2130CC7F",
504
- },
505
- ],
506
- },
507
- "Type": "AWS::IAM::Policy",
508
- },
509
- "workerposthook150842D6": {
510
- "DependsOn": [
511
- "workerposthookServiceRoleDefaultPolicy6A92F69C",
512
- "workerposthookServiceRole25452300",
513
- ],
514
- "Properties": {
515
- "Architectures": [
516
- "arm64",
517
- ],
518
- "Code": {
519
- "S3Bucket": {
520
- "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}",
521
- },
522
- "S3Key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.zip",
523
- },
524
- "Environment": {
525
- "Variables": {
526
- "ENVIRONMENT": "dev",
527
- "FUNCTION_NAME_TO_PRUNE": {
528
- "Ref": "worker28EA3E30",
529
- },
530
- "NODE_ENV": "production",
531
- "NODE_OPTIONS": "--enable-source-maps",
532
- "SERVICE": "serviceName",
533
- "VERSION": "local",
534
- },
535
- },
536
- "FunctionName": "serviceName-post-hook",
537
- "Handler": "index.handler",
538
- "KmsKeyArn": {
539
- "Fn::GetAtt": [
540
- "kmskey49FBC3B3",
541
- "Arn",
542
- ],
543
- },
544
- "Role": {
545
- "Fn::GetAtt": [
546
- "workerposthookServiceRole25452300",
547
- "Arn",
548
- ],
549
- },
550
- "Runtime": "nodejs20.x",
551
- "Timeout": 30,
552
- },
553
- "Type": "AWS::Lambda::Function",
554
- },
555
- "workerposthookServiceRole25452300": {
556
- "Properties": {
557
- "AssumeRolePolicyDocument": {
558
- "Statement": [
559
- {
560
- "Action": "sts:AssumeRole",
561
- "Effect": "Allow",
562
- "Principal": {
563
- "Service": "lambda.amazonaws.com",
564
- },
565
- },
566
- ],
567
- "Version": "2012-10-17",
568
- },
569
- "ManagedPolicyArns": [
570
- {
571
- "Fn::Join": [
572
- "",
573
- [
574
- "arn:",
575
- {
576
- "Ref": "AWS::Partition",
577
- },
578
- ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
579
- ],
580
- ],
581
- },
582
- ],
583
- },
584
- "Type": "AWS::IAM::Role",
585
- },
586
- "workerposthookServiceRoleDefaultPolicy6A92F69C": {
587
- "Properties": {
588
- "PolicyDocument": {
589
- "Statement": [
590
- {
591
- "Action": [
592
- "lambda:ListAliases",
593
- "lambda:ListVersionsByFunction",
594
- "lambda:DeleteFunction",
595
- ],
455
+ "Action": "lambda:InvokeFunction",
596
456
  "Effect": "Allow",
597
457
  "Resource": [
598
458
  {
599
- "Fn::GetAtt": [
600
- "worker28EA3E30",
601
- "Arn",
459
+ "Fn::Join": [
460
+ "",
461
+ [
462
+ "arn:",
463
+ {
464
+ "Ref": "AWS::Partition",
465
+ },
466
+ ":lambda:",
467
+ {
468
+ "Ref": "AWS::Region",
469
+ },
470
+ ":",
471
+ {
472
+ "Ref": "AWS::AccountId",
473
+ },
474
+ ":function:aws-codedeploy-hook-AfterAllowTraffic",
475
+ ],
602
476
  ],
603
477
  },
604
478
  {
605
479
  "Fn::Join": [
606
480
  "",
607
481
  [
482
+ "arn:",
483
+ {
484
+ "Ref": "AWS::Partition",
485
+ },
486
+ ":lambda:",
487
+ {
488
+ "Ref": "AWS::Region",
489
+ },
490
+ ":",
608
491
  {
609
- "Fn::GetAtt": [
610
- "worker28EA3E30",
611
- "Arn",
612
- ],
492
+ "Ref": "AWS::AccountId",
613
493
  },
614
- ":*",
494
+ ":function:aws-codedeploy-hook-AfterAllowTraffic:*",
615
495
  ],
616
496
  ],
617
497
  },
618
498
  ],
619
499
  },
620
- {
621
- "Action": "codedeploy:PutLifecycleEventHookExecutionStatus",
622
- "Effect": "Allow",
623
- "Resource": {
624
- "Fn::Join": [
625
- "",
626
- [
627
- "arn:",
628
- {
629
- "Ref": "AWS::Partition",
630
- },
631
- ":codedeploy:",
632
- {
633
- "Ref": "AWS::Region",
634
- },
635
- ":",
636
- {
637
- "Ref": "AWS::AccountId",
638
- },
639
- ":deploymentgroup:",
640
- {
641
- "Ref": "codedeployapplicationF49B9864",
642
- },
643
- "/",
644
- {
645
- "Ref": "codedeploygroup441B094B",
646
- },
647
- ],
648
- ],
649
- },
650
- },
651
500
  ],
652
501
  "Version": "2012-10-17",
653
502
  },
654
- "PolicyName": "workerposthookServiceRoleDefaultPolicy6A92F69C",
503
+ "PolicyName": "workerDeploymentCodeDeployLambdaDeploymentGroupServiceRoleDefaultPolicy30B750B5",
655
504
  "Roles": [
656
505
  {
657
- "Ref": "workerposthookServiceRole25452300",
506
+ "Ref": "workerDeploymentCodeDeployLambdaDeploymentGroupServiceRole351C6FAE",
658
507
  },
659
508
  ],
660
509
  },
661
510
  "Type": "AWS::IAM::Policy",
662
511
  },
663
- "workerprehook415B13CE": {
664
- "DependsOn": [
665
- "workerprehookServiceRoleDefaultPolicy991A21B9",
666
- "workerprehookServiceRole8F8D9379",
667
- ],
668
- "Properties": {
669
- "Architectures": [
670
- "arm64",
671
- ],
672
- "Code": {
673
- "S3Bucket": {
674
- "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}",
675
- },
676
- "S3Key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.zip",
677
- },
678
- "Environment": {
679
- "Variables": {
680
- "ENVIRONMENT": "dev",
681
- "FUNCTION_NAME_TO_INVOKE": {
682
- "Ref": "worker28EA3E30",
683
- },
684
- "NODE_ENV": "production",
685
- "NODE_OPTIONS": "--enable-source-maps",
686
- "SERVICE": "serviceName",
687
- "VERSION": "local",
688
- },
689
- },
690
- "FunctionName": "serviceName-pre-hook",
691
- "Handler": "index.handler",
692
- "KmsKeyArn": {
693
- "Fn::GetAtt": [
694
- "kmskey49FBC3B3",
695
- "Arn",
696
- ],
697
- },
698
- "Role": {
699
- "Fn::GetAtt": [
700
- "workerprehookServiceRole8F8D9379",
701
- "Arn",
702
- ],
703
- },
704
- "Runtime": "nodejs20.x",
705
- "Timeout": 120,
706
- },
707
- "Type": "AWS::Lambda::Function",
708
- },
709
- "workerprehookServiceRole8F8D9379": {
512
+ "workerServiceRole2130CC7F": {
710
513
  "Properties": {
711
514
  "AssumeRolePolicyDocument": {
712
515
  "Statement": [
@@ -734,77 +537,52 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
734
537
  ],
735
538
  },
736
539
  ],
540
+ "Tags": [
541
+ {
542
+ "Key": "aws-codedeploy-hooks",
543
+ "Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
544
+ },
545
+ ],
737
546
  },
738
547
  "Type": "AWS::IAM::Role",
739
548
  },
740
- "workerprehookServiceRoleDefaultPolicy991A21B9": {
549
+ "workerServiceRoleDefaultPolicyBA498553": {
741
550
  "Properties": {
742
551
  "PolicyDocument": {
743
552
  "Statement": [
744
553
  {
745
- "Action": "lambda:InvokeFunction",
746
- "Effect": "Allow",
747
- "Resource": [
748
- {
749
- "Fn::GetAtt": [
750
- "worker28EA3E30",
751
- "Arn",
752
- ],
753
- },
754
- {
755
- "Fn::Join": [
756
- "",
757
- [
758
- {
759
- "Fn::GetAtt": [
760
- "worker28EA3E30",
761
- "Arn",
762
- ],
763
- },
764
- ":*",
765
- ],
766
- ],
767
- },
554
+ "Action": [
555
+ "sqs:ReceiveMessage",
556
+ "sqs:ChangeMessageVisibility",
557
+ "sqs:GetQueueUrl",
558
+ "sqs:DeleteMessage",
559
+ "sqs:GetQueueAttributes",
768
560
  ],
561
+ "Effect": "Allow",
562
+ "Resource": {
563
+ "Fn::GetAtt": [
564
+ "workerqueueA05CE5C6",
565
+ "Arn",
566
+ ],
567
+ },
769
568
  },
770
569
  {
771
- "Action": "codedeploy:PutLifecycleEventHookExecutionStatus",
570
+ "Action": "kms:Decrypt",
772
571
  "Effect": "Allow",
773
572
  "Resource": {
774
- "Fn::Join": [
775
- "",
776
- [
777
- "arn:",
778
- {
779
- "Ref": "AWS::Partition",
780
- },
781
- ":codedeploy:",
782
- {
783
- "Ref": "AWS::Region",
784
- },
785
- ":",
786
- {
787
- "Ref": "AWS::AccountId",
788
- },
789
- ":deploymentgroup:",
790
- {
791
- "Ref": "codedeployapplicationF49B9864",
792
- },
793
- "/",
794
- {
795
- "Ref": "codedeploygroup441B094B",
796
- },
797
- ],
573
+ "Fn::GetAtt": [
574
+ "kmskey49FBC3B3",
575
+ "Arn",
798
576
  ],
799
577
  },
800
578
  },
801
579
  ],
802
580
  "Version": "2012-10-17",
803
581
  },
804
- "PolicyName": "workerprehookServiceRoleDefaultPolicy991A21B9",
582
+ "PolicyName": "workerServiceRoleDefaultPolicyBA498553",
805
583
  "Roles": [
806
584
  {
807
- "Ref": "workerprehookServiceRole8F8D9379",
585
+ "Ref": "workerServiceRole2130CC7F",
808
586
  },
809
587
  ],
810
588
  },
@@ -941,190 +719,15 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
941
719
  },
942
720
  },
943
721
  "Resources": {
944
- "codedeployalarm9F48D05F": {
945
- "Properties": {
946
- "ComparisonOperator": "GreaterThanOrEqualToThreshold",
947
- "Dimensions": [
948
- {
949
- "Name": "FunctionName",
950
- "Value": {
951
- "Ref": "worker28EA3E30",
952
- },
953
- },
954
- {
955
- "Name": "Resource",
956
- "Value": {
957
- "Fn::Join": [
958
- "",
959
- [
960
- {
961
- "Ref": "worker28EA3E30",
962
- },
963
- ":live",
964
- ],
965
- ],
966
- },
967
- },
968
- ],
969
- "EvaluationPeriods": 1,
970
- "MetricName": "Errors",
971
- "Namespace": "AWS/Lambda",
972
- "Period": 60,
973
- "Statistic": "Sum",
974
- "Threshold": 1,
975
- },
976
- "Type": "AWS::CloudWatch::Alarm",
977
- },
978
- "codedeployapplicationF49B9864": {
979
- "Properties": {
980
- "ComputePlatform": "Lambda",
981
- },
982
- "Type": "AWS::CodeDeploy::Application",
983
- },
984
- "codedeploygroup441B094B": {
985
- "Properties": {
986
- "AlarmConfiguration": {
987
- "Alarms": [
988
- {
989
- "Name": {
990
- "Ref": "codedeployalarm9F48D05F",
991
- },
992
- },
993
- ],
994
- "Enabled": true,
995
- },
996
- "ApplicationName": {
997
- "Ref": "codedeployapplicationF49B9864",
998
- },
999
- "AutoRollbackConfiguration": {
1000
- "Enabled": true,
1001
- "Events": [
1002
- "DEPLOYMENT_FAILURE",
1003
- "DEPLOYMENT_STOP_ON_ALARM",
1004
- ],
1005
- },
1006
- "DeploymentConfigName": "CodeDeployDefault.LambdaAllAtOnce",
1007
- "DeploymentStyle": {
1008
- "DeploymentOption": "WITH_TRAFFIC_CONTROL",
1009
- "DeploymentType": "BLUE_GREEN",
1010
- },
1011
- "ServiceRoleArn": {
1012
- "Fn::GetAtt": [
1013
- "codedeploygroupServiceRole1BD49E37",
1014
- "Arn",
1015
- ],
1016
- },
1017
- },
1018
- "Type": "AWS::CodeDeploy::DeploymentGroup",
1019
- },
1020
- "codedeploygroupServiceRole1BD49E37": {
722
+ "kmskey49FBC3B3": {
723
+ "DeletionPolicy": "Retain",
1021
724
  "Properties": {
1022
- "AssumeRolePolicyDocument": {
725
+ "Description": "serviceName",
726
+ "EnableKeyRotation": true,
727
+ "KeyPolicy": {
1023
728
  "Statement": [
1024
729
  {
1025
- "Action": "sts:AssumeRole",
1026
- "Effect": "Allow",
1027
- "Principal": {
1028
- "Service": "codedeploy.amazonaws.com",
1029
- },
1030
- },
1031
- ],
1032
- "Version": "2012-10-17",
1033
- },
1034
- "ManagedPolicyArns": [
1035
- {
1036
- "Fn::Join": [
1037
- "",
1038
- [
1039
- "arn:",
1040
- {
1041
- "Ref": "AWS::Partition",
1042
- },
1043
- ":iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
1044
- ],
1045
- ],
1046
- },
1047
- ],
1048
- },
1049
- "Type": "AWS::IAM::Role",
1050
- },
1051
- "codedeploygroupServiceRoleDefaultPolicy2027BC9A": {
1052
- "Properties": {
1053
- "PolicyDocument": {
1054
- "Statement": [
1055
- {
1056
- "Action": "lambda:InvokeFunction",
1057
- "Effect": "Allow",
1058
- "Resource": [
1059
- {
1060
- "Fn::GetAtt": [
1061
- "workerprehook415B13CE",
1062
- "Arn",
1063
- ],
1064
- },
1065
- {
1066
- "Fn::Join": [
1067
- "",
1068
- [
1069
- {
1070
- "Fn::GetAtt": [
1071
- "workerprehook415B13CE",
1072
- "Arn",
1073
- ],
1074
- },
1075
- ":*",
1076
- ],
1077
- ],
1078
- },
1079
- ],
1080
- },
1081
- {
1082
- "Action": "lambda:InvokeFunction",
1083
- "Effect": "Allow",
1084
- "Resource": [
1085
- {
1086
- "Fn::GetAtt": [
1087
- "workerposthook150842D6",
1088
- "Arn",
1089
- ],
1090
- },
1091
- {
1092
- "Fn::Join": [
1093
- "",
1094
- [
1095
- {
1096
- "Fn::GetAtt": [
1097
- "workerposthook150842D6",
1098
- "Arn",
1099
- ],
1100
- },
1101
- ":*",
1102
- ],
1103
- ],
1104
- },
1105
- ],
1106
- },
1107
- ],
1108
- "Version": "2012-10-17",
1109
- },
1110
- "PolicyName": "codedeploygroupServiceRoleDefaultPolicy2027BC9A",
1111
- "Roles": [
1112
- {
1113
- "Ref": "codedeploygroupServiceRole1BD49E37",
1114
- },
1115
- ],
1116
- },
1117
- "Type": "AWS::IAM::Policy",
1118
- },
1119
- "kmskey49FBC3B3": {
1120
- "DeletionPolicy": "Retain",
1121
- "Properties": {
1122
- "Description": "serviceName",
1123
- "EnableKeyRotation": true,
1124
- "KeyPolicy": {
1125
- "Statement": [
1126
- {
1127
- "Action": "kms:*",
730
+ "Action": "kms:*",
1128
731
  "Effect": "Allow",
1129
732
  "Principal": {
1130
733
  "AWS": {
@@ -1285,11 +888,17 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
1285
888
  ],
1286
889
  },
1287
890
  "Runtime": "nodejs20.x",
891
+ "Tags": [
892
+ {
893
+ "Key": "aws-codedeploy-hooks",
894
+ "Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
895
+ },
896
+ ],
1288
897
  "Timeout": 30,
1289
898
  },
1290
899
  "Type": "AWS::Lambda::Function",
1291
900
  },
1292
- "workerAliaslive62FE5FAF": {
901
+ "workerAliasLive4B82F015": {
1293
902
  "Properties": {
1294
903
  "Description": "The Lambda version currently receiving traffic",
1295
904
  "FunctionName": {
@@ -1301,27 +910,81 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
1301
910
  "Version",
1302
911
  ],
1303
912
  },
1304
- "Name": "live",
913
+ "Name": "Live",
1305
914
  },
1306
915
  "Type": "AWS::Lambda::Alias",
1307
916
  "UpdatePolicy": {
1308
917
  "CodeDeployLambdaAliasUpdate": {
1309
918
  "AfterAllowTrafficHook": {
1310
- "Ref": "workerposthook150842D6",
919
+ "Fn::Select": [
920
+ 6,
921
+ {
922
+ "Fn::Split": [
923
+ ":",
924
+ {
925
+ "Fn::Join": [
926
+ "",
927
+ [
928
+ "arn:",
929
+ {
930
+ "Ref": "AWS::Partition",
931
+ },
932
+ ":lambda:",
933
+ {
934
+ "Ref": "AWS::Region",
935
+ },
936
+ ":",
937
+ {
938
+ "Ref": "AWS::AccountId",
939
+ },
940
+ ":function:aws-codedeploy-hook-AfterAllowTraffic",
941
+ ],
942
+ ],
943
+ },
944
+ ],
945
+ },
946
+ ],
1311
947
  },
1312
948
  "ApplicationName": {
1313
- "Ref": "codedeployapplicationF49B9864",
949
+ "Ref": "workerDeploymentCodeDeployLambdaApplication9974008D",
1314
950
  },
1315
951
  "BeforeAllowTrafficHook": {
1316
- "Ref": "workerprehook415B13CE",
952
+ "Fn::Select": [
953
+ 6,
954
+ {
955
+ "Fn::Split": [
956
+ ":",
957
+ {
958
+ "Fn::Join": [
959
+ "",
960
+ [
961
+ "arn:",
962
+ {
963
+ "Ref": "AWS::Partition",
964
+ },
965
+ ":lambda:",
966
+ {
967
+ "Ref": "AWS::Region",
968
+ },
969
+ ":",
970
+ {
971
+ "Ref": "AWS::AccountId",
972
+ },
973
+ ":function:aws-codedeploy-hook-BeforeAllowTraffic",
974
+ ],
975
+ ],
976
+ },
977
+ ],
978
+ },
979
+ ],
1317
980
  },
1318
981
  "DeploymentGroupName": {
1319
- "Ref": "codedeploygroup441B094B",
982
+ "Ref": "workerDeploymentCodeDeployLambdaDeploymentGroupF884ECDA",
1320
983
  },
1321
984
  },
1322
985
  },
1323
986
  },
1324
- "workerAliasliveSqsEventSourceappStackworkerqueue8281B9F42DEDB47B": {
987
+ "workerAliasLiveSqsEventSourceappStackworkerqueue8281B9F443B0CF93": {
1325
988
  "Properties": {
1326
989
  "EventSourceArn": {
1327
990
  "Fn::GetAtt": [
@@ -1340,19 +1003,22 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
1340
1003
  "Fn::Split": [
1341
1004
  ":",
1342
1005
  {
1343
- "Ref": "workerAliaslive62FE5FAF",
1006
+ "Ref": "workerAliasLive4B82F015",
1344
1007
  },
1345
1008
  ],
1346
1009
  },
1347
1010
  ],
1348
1011
  },
1349
- ":live",
1012
+ ":Live",
1350
1013
  ],
1351
1014
  ],
1352
1015
  },
1353
- "ScalingConfig": {
1354
- "MaximumConcurrency": 20,
1355
- },
1016
+ "Tags": [
1017
+ {
1018
+ "Key": "aws-codedeploy-hooks",
1019
+ "Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
1020
+ },
1021
+ ],
1356
1022
  },
1357
1023
  "Type": "AWS::Lambda::EventSourceMapping",
1358
1024
  },
@@ -1364,126 +1030,50 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
1364
1030
  },
1365
1031
  "Type": "AWS::Lambda::Version",
1366
1032
  },
1367
- "workerServiceRole2130CC7F": {
1033
+ "workerDeploymentCodeDeployLambdaApplication9974008D": {
1368
1034
  "Properties": {
1369
- "AssumeRolePolicyDocument": {
1370
- "Statement": [
1371
- {
1372
- "Action": "sts:AssumeRole",
1373
- "Effect": "Allow",
1374
- "Principal": {
1375
- "Service": "lambda.amazonaws.com",
1376
- },
1377
- },
1378
- ],
1379
- "Version": "2012-10-17",
1380
- },
1381
- "ManagedPolicyArns": [
1382
- {
1383
- "Fn::Join": [
1384
- "",
1385
- [
1386
- "arn:",
1387
- {
1388
- "Ref": "AWS::Partition",
1389
- },
1390
- ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
1391
- ],
1392
- ],
1393
- },
1394
- ],
1395
- },
1396
- "Type": "AWS::IAM::Role",
1397
- },
1398
- "workerServiceRoleDefaultPolicyBA498553": {
1399
- "Properties": {
1400
- "PolicyDocument": {
1401
- "Statement": [
1402
- {
1403
- "Action": [
1404
- "sqs:ReceiveMessage",
1405
- "sqs:ChangeMessageVisibility",
1406
- "sqs:GetQueueUrl",
1407
- "sqs:DeleteMessage",
1408
- "sqs:GetQueueAttributes",
1409
- ],
1410
- "Effect": "Allow",
1411
- "Resource": {
1412
- "Fn::GetAtt": [
1413
- "workerqueueA05CE5C6",
1414
- "Arn",
1415
- ],
1416
- },
1417
- },
1418
- {
1419
- "Action": "kms:Decrypt",
1420
- "Effect": "Allow",
1421
- "Resource": {
1422
- "Fn::GetAtt": [
1423
- "kmskey49FBC3B3",
1424
- "Arn",
1425
- ],
1426
- },
1427
- },
1428
- ],
1429
- "Version": "2012-10-17",
1430
- },
1431
- "PolicyName": "workerServiceRoleDefaultPolicyBA498553",
1432
- "Roles": [
1035
+ "ComputePlatform": "Lambda",
1036
+ "Tags": [
1433
1037
  {
1434
- "Ref": "workerServiceRole2130CC7F",
1038
+ "Key": "aws-codedeploy-hooks",
1039
+ "Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
1435
1040
  },
1436
1041
  ],
1437
1042
  },
1438
- "Type": "AWS::IAM::Policy",
1043
+ "Type": "AWS::CodeDeploy::Application",
1439
1044
  },
1440
- "workerposthook150842D6": {
1441
- "DependsOn": [
1442
- "workerposthookServiceRoleDefaultPolicy6A92F69C",
1443
- "workerposthookServiceRole25452300",
1444
- ],
1045
+ "workerDeploymentCodeDeployLambdaDeploymentGroupF884ECDA": {
1445
1046
  "Properties": {
1446
- "Architectures": [
1447
- "arm64",
1448
- ],
1449
- "Code": {
1450
- "S3Bucket": {
1451
- "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}",
1452
- },
1453
- "S3Key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.zip",
1454
- },
1455
- "Environment": {
1456
- "Variables": {
1457
- "ENVIRONMENT": "prod",
1458
- "FUNCTION_NAME_TO_PRUNE": {
1459
- "Ref": "worker28EA3E30",
1460
- },
1461
- "NODE_ENV": "production",
1462
- "NODE_OPTIONS": "--enable-source-maps",
1463
- "SERVICE": "serviceName",
1464
- "VERSION": "local",
1465
- },
1047
+ "ApplicationName": {
1048
+ "Ref": "workerDeploymentCodeDeployLambdaApplication9974008D",
1466
1049
  },
1467
- "FunctionName": "serviceName-post-hook",
1468
- "Handler": "index.handler",
1469
- "KmsKeyArn": {
1470
- "Fn::GetAtt": [
1471
- "kmskey49FBC3B3",
1472
- "Arn",
1050
+ "AutoRollbackConfiguration": {
1051
+ "Enabled": true,
1052
+ "Events": [
1053
+ "DEPLOYMENT_FAILURE",
1473
1054
  ],
1474
1055
  },
1475
- "Role": {
1056
+ "DeploymentConfigName": "CodeDeployDefault.LambdaAllAtOnce",
1057
+ "DeploymentStyle": {
1058
+ "DeploymentOption": "WITH_TRAFFIC_CONTROL",
1059
+ "DeploymentType": "BLUE_GREEN",
1060
+ },
1061
+ "ServiceRoleArn": {
1476
1062
  "Fn::GetAtt": [
1477
- "workerposthookServiceRole25452300",
1063
+ "workerDeploymentCodeDeployLambdaDeploymentGroupServiceRole351C6FAE",
1478
1064
  "Arn",
1479
1065
  ],
1480
1066
  },
1481
- "Runtime": "nodejs20.x",
1482
- "Timeout": 30,
1067
+ "Tags": [
1068
+ {
1069
+ "Key": "aws-codedeploy-hooks",
1070
+ "Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
1071
+ },
1072
+ ],
1483
1073
  },
1484
- "Type": "AWS::Lambda::Function",
1074
+ "Type": "AWS::CodeDeploy::DeploymentGroup",
1485
1075
  },
1486
- "workerposthookServiceRole25452300": {
1076
+ "workerDeploymentCodeDeployLambdaDeploymentGroupServiceRole351C6FAE": {
1487
1077
  "Properties": {
1488
1078
  "AssumeRolePolicyDocument": {
1489
1079
  "Statement": [
@@ -1491,7 +1081,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
1491
1081
  "Action": "sts:AssumeRole",
1492
1082
  "Effect": "Allow",
1493
1083
  "Principal": {
1494
- "Service": "lambda.amazonaws.com",
1084
+ "Service": "codedeploy.amazonaws.com",
1495
1085
  },
1496
1086
  },
1497
1087
  ],
@@ -1506,138 +1096,129 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
1506
1096
  {
1507
1097
  "Ref": "AWS::Partition",
1508
1098
  },
1509
- ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
1099
+ ":iam::aws:policy/service-role/AWSCodeDeployRoleForLambdaLimited",
1510
1100
  ],
1511
1101
  ],
1512
1102
  },
1513
1103
  ],
1104
+ "Tags": [
1105
+ {
1106
+ "Key": "aws-codedeploy-hooks",
1107
+ "Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
1108
+ },
1109
+ ],
1514
1110
  },
1515
1111
  "Type": "AWS::IAM::Role",
1516
1112
  },
1517
- "workerposthookServiceRoleDefaultPolicy6A92F69C": {
1113
+ "workerDeploymentCodeDeployLambdaDeploymentGroupServiceRoleDefaultPolicy30B750B5": {
1518
1114
  "Properties": {
1519
1115
  "PolicyDocument": {
1520
1116
  "Statement": [
1521
1117
  {
1522
- "Action": [
1523
- "lambda:ListAliases",
1524
- "lambda:ListVersionsByFunction",
1525
- "lambda:DeleteFunction",
1526
- ],
1118
+ "Action": "lambda:InvokeFunction",
1527
1119
  "Effect": "Allow",
1528
1120
  "Resource": [
1529
1121
  {
1530
- "Fn::GetAtt": [
1531
- "worker28EA3E30",
1532
- "Arn",
1122
+ "Fn::Join": [
1123
+ "",
1124
+ [
1125
+ "arn:",
1126
+ {
1127
+ "Ref": "AWS::Partition",
1128
+ },
1129
+ ":lambda:",
1130
+ {
1131
+ "Ref": "AWS::Region",
1132
+ },
1133
+ ":",
1134
+ {
1135
+ "Ref": "AWS::AccountId",
1136
+ },
1137
+ ":function:aws-codedeploy-hook-BeforeAllowTraffic",
1138
+ ],
1533
1139
  ],
1534
1140
  },
1535
1141
  {
1536
1142
  "Fn::Join": [
1537
1143
  "",
1538
1144
  [
1145
+ "arn:",
1146
+ {
1147
+ "Ref": "AWS::Partition",
1148
+ },
1149
+ ":lambda:",
1150
+ {
1151
+ "Ref": "AWS::Region",
1152
+ },
1153
+ ":",
1539
1154
  {
1540
- "Fn::GetAtt": [
1541
- "worker28EA3E30",
1542
- "Arn",
1543
- ],
1155
+ "Ref": "AWS::AccountId",
1544
1156
  },
1545
- ":*",
1157
+ ":function:aws-codedeploy-hook-BeforeAllowTraffic:*",
1546
1158
  ],
1547
1159
  ],
1548
1160
  },
1549
1161
  ],
1550
1162
  },
1551
1163
  {
1552
- "Action": "codedeploy:PutLifecycleEventHookExecutionStatus",
1164
+ "Action": "lambda:InvokeFunction",
1553
1165
  "Effect": "Allow",
1554
- "Resource": {
1555
- "Fn::Join": [
1556
- "",
1557
- [
1558
- "arn:",
1559
- {
1560
- "Ref": "AWS::Partition",
1561
- },
1562
- ":codedeploy:",
1563
- {
1564
- "Ref": "AWS::Region",
1565
- },
1566
- ":",
1567
- {
1568
- "Ref": "AWS::AccountId",
1569
- },
1570
- ":deploymentgroup:",
1571
- {
1572
- "Ref": "codedeployapplicationF49B9864",
1573
- },
1574
- "/",
1575
- {
1576
- "Ref": "codedeploygroup441B094B",
1577
- },
1166
+ "Resource": [
1167
+ {
1168
+ "Fn::Join": [
1169
+ "",
1170
+ [
1171
+ "arn:",
1172
+ {
1173
+ "Ref": "AWS::Partition",
1174
+ },
1175
+ ":lambda:",
1176
+ {
1177
+ "Ref": "AWS::Region",
1178
+ },
1179
+ ":",
1180
+ {
1181
+ "Ref": "AWS::AccountId",
1182
+ },
1183
+ ":function:aws-codedeploy-hook-AfterAllowTraffic",
1184
+ ],
1578
1185
  ],
1579
- ],
1580
- },
1186
+ },
1187
+ {
1188
+ "Fn::Join": [
1189
+ "",
1190
+ [
1191
+ "arn:",
1192
+ {
1193
+ "Ref": "AWS::Partition",
1194
+ },
1195
+ ":lambda:",
1196
+ {
1197
+ "Ref": "AWS::Region",
1198
+ },
1199
+ ":",
1200
+ {
1201
+ "Ref": "AWS::AccountId",
1202
+ },
1203
+ ":function:aws-codedeploy-hook-AfterAllowTraffic:*",
1204
+ ],
1205
+ ],
1206
+ },
1207
+ ],
1581
1208
  },
1582
1209
  ],
1583
1210
  "Version": "2012-10-17",
1584
1211
  },
1585
- "PolicyName": "workerposthookServiceRoleDefaultPolicy6A92F69C",
1212
+ "PolicyName": "workerDeploymentCodeDeployLambdaDeploymentGroupServiceRoleDefaultPolicy30B750B5",
1586
1213
  "Roles": [
1587
1214
  {
1588
- "Ref": "workerposthookServiceRole25452300",
1215
+ "Ref": "workerDeploymentCodeDeployLambdaDeploymentGroupServiceRole351C6FAE",
1589
1216
  },
1590
1217
  ],
1591
1218
  },
1592
1219
  "Type": "AWS::IAM::Policy",
1593
1220
  },
1594
- "workerprehook415B13CE": {
1595
- "DependsOn": [
1596
- "workerprehookServiceRoleDefaultPolicy991A21B9",
1597
- "workerprehookServiceRole8F8D9379",
1598
- ],
1599
- "Properties": {
1600
- "Architectures": [
1601
- "arm64",
1602
- ],
1603
- "Code": {
1604
- "S3Bucket": {
1605
- "Fn::Sub": "cdk-hnb659fds-assets-\${AWS::AccountId}-\${AWS::Region}",
1606
- },
1607
- "S3Key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.zip",
1608
- },
1609
- "Environment": {
1610
- "Variables": {
1611
- "ENVIRONMENT": "prod",
1612
- "FUNCTION_NAME_TO_INVOKE": {
1613
- "Ref": "worker28EA3E30",
1614
- },
1615
- "NODE_ENV": "production",
1616
- "NODE_OPTIONS": "--enable-source-maps",
1617
- "SERVICE": "serviceName",
1618
- "VERSION": "local",
1619
- },
1620
- },
1621
- "FunctionName": "serviceName-pre-hook",
1622
- "Handler": "index.handler",
1623
- "KmsKeyArn": {
1624
- "Fn::GetAtt": [
1625
- "kmskey49FBC3B3",
1626
- "Arn",
1627
- ],
1628
- },
1629
- "Role": {
1630
- "Fn::GetAtt": [
1631
- "workerprehookServiceRole8F8D9379",
1632
- "Arn",
1633
- ],
1634
- },
1635
- "Runtime": "nodejs20.x",
1636
- "Timeout": 120,
1637
- },
1638
- "Type": "AWS::Lambda::Function",
1639
- },
1640
- "workerprehookServiceRole8F8D9379": {
1221
+ "workerServiceRole2130CC7F": {
1641
1222
  "Properties": {
1642
1223
  "AssumeRolePolicyDocument": {
1643
1224
  "Statement": [
@@ -1665,77 +1246,52 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
1665
1246
  ],
1666
1247
  },
1667
1248
  ],
1249
+ "Tags": [
1250
+ {
1251
+ "Key": "aws-codedeploy-hooks",
1252
+ "Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
1253
+ },
1254
+ ],
1668
1255
  },
1669
1256
  "Type": "AWS::IAM::Role",
1670
1257
  },
1671
- "workerprehookServiceRoleDefaultPolicy991A21B9": {
1258
+ "workerServiceRoleDefaultPolicyBA498553": {
1672
1259
  "Properties": {
1673
1260
  "PolicyDocument": {
1674
1261
  "Statement": [
1675
1262
  {
1676
- "Action": "lambda:InvokeFunction",
1677
- "Effect": "Allow",
1678
- "Resource": [
1679
- {
1680
- "Fn::GetAtt": [
1681
- "worker28EA3E30",
1682
- "Arn",
1683
- ],
1684
- },
1685
- {
1686
- "Fn::Join": [
1687
- "",
1688
- [
1689
- {
1690
- "Fn::GetAtt": [
1691
- "worker28EA3E30",
1692
- "Arn",
1693
- ],
1694
- },
1695
- ":*",
1696
- ],
1697
- ],
1698
- },
1263
+ "Action": [
1264
+ "sqs:ReceiveMessage",
1265
+ "sqs:ChangeMessageVisibility",
1266
+ "sqs:GetQueueUrl",
1267
+ "sqs:DeleteMessage",
1268
+ "sqs:GetQueueAttributes",
1699
1269
  ],
1270
+ "Effect": "Allow",
1271
+ "Resource": {
1272
+ "Fn::GetAtt": [
1273
+ "workerqueueA05CE5C6",
1274
+ "Arn",
1275
+ ],
1276
+ },
1700
1277
  },
1701
1278
  {
1702
- "Action": "codedeploy:PutLifecycleEventHookExecutionStatus",
1279
+ "Action": "kms:Decrypt",
1703
1280
  "Effect": "Allow",
1704
1281
  "Resource": {
1705
- "Fn::Join": [
1706
- "",
1707
- [
1708
- "arn:",
1709
- {
1710
- "Ref": "AWS::Partition",
1711
- },
1712
- ":codedeploy:",
1713
- {
1714
- "Ref": "AWS::Region",
1715
- },
1716
- ":",
1717
- {
1718
- "Ref": "AWS::AccountId",
1719
- },
1720
- ":deploymentgroup:",
1721
- {
1722
- "Ref": "codedeployapplicationF49B9864",
1723
- },
1724
- "/",
1725
- {
1726
- "Ref": "codedeploygroup441B094B",
1727
- },
1728
- ],
1282
+ "Fn::GetAtt": [
1283
+ "kmskey49FBC3B3",
1284
+ "Arn",
1729
1285
  ],
1730
1286
  },
1731
1287
  },
1732
1288
  ],
1733
1289
  "Version": "2012-10-17",
1734
1290
  },
1735
- "PolicyName": "workerprehookServiceRoleDefaultPolicy991A21B9",
1291
+ "PolicyName": "workerServiceRoleDefaultPolicyBA498553",
1736
1292
  "Roles": [
1737
1293
  {
1738
- "Ref": "workerprehookServiceRole8F8D9379",
1294
+ "Ref": "workerServiceRole2130CC7F",
1739
1295
  },
1740
1296
  ],
1741
1297
  },