Skip to content

Commit 08e268a

Browse files
authored
chore: forward merge 'master' into 'v2-main' (#20004)
Automated action from aws/cdk-ops
2 parents 7e1a978 + 6aa159b commit 08e268a

File tree

34 files changed

+563
-117
lines changed

34 files changed

+563
-117
lines changed

allowed-breaking-changes.txt

+6
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,9 @@ removed:@aws-cdk/aws-s3.BucketProps.eventBridgeEnabled
130130
# changed the type of RDS's SnapshotCredentials.secret from Secret to ISecret,
131131
# shouldn't matter
132132
changed-type:@aws-cdk/aws-rds.SnapshotCredentials.secret
133+
134+
# removed property from kafka eventsources as they are not supported
135+
removed:@aws-cdk/aws-lambda-event-sources.BaseStreamEventSourceProps.onFailure
136+
removed:@aws-cdk/aws-lambda-event-sources.KafkaEventSourceProps.onFailure
137+
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.onFailure
138+
removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.onFailure

packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/batch-stack.template.json

-5
Original file line numberDiff line numberDiff line change
@@ -1362,11 +1362,6 @@
13621362
},
13631363
"batchjobrepo4C508C51": {
13641364
"Type": "AWS::ECR::Repository",
1365-
"Properties": {
1366-
"ImageScanningConfiguration": {
1367-
"ScanOnPush": false
1368-
}
1369-
},
13701365
"UpdateReplacePolicy": "Retain",
13711366
"DeletionPolicy": "Retain"
13721367
},

packages/@aws-cdk/aws-batch/test/batch.integ.snapshot/tree.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -1601,11 +1601,7 @@
16011601
"path": "batch-stack/batch-job-repo/Resource",
16021602
"attributes": {
16031603
"aws:cdk:cloudformation:type": "AWS::ECR::Repository",
1604-
"aws:cdk:cloudformation:props": {
1605-
"imageScanningConfiguration": {
1606-
"scanOnPush": false
1607-
}
1608-
}
1604+
"aws:cdk:cloudformation:props": {}
16091605
},
16101606
"constructInfo": {
16111607
"fqn": "@aws-cdk/aws-ecr.CfnRepository",

packages/@aws-cdk/aws-codebuild/test/ecr.lit.integ.snapshot/test-codebuild-docker-asset.template.json

-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
"Resources": {
33
"MyRepoF4F48043": {
44
"Type": "AWS::ECR::Repository",
5-
"Properties": {
6-
"ImageScanningConfiguration": {
7-
"ScanOnPush": false
8-
}
9-
},
105
"UpdateReplacePolicy": "Retain",
116
"DeletionPolicy": "Retain"
127
},

packages/@aws-cdk/aws-codebuild/test/ecr.lit.integ.snapshot/tree.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@
2525
"path": "test-codebuild-docker-asset/MyRepo/Resource",
2626
"attributes": {
2727
"aws:cdk:cloudformation:type": "AWS::ECR::Repository",
28-
"aws:cdk:cloudformation:props": {
29-
"imageScanningConfiguration": {
30-
"scanOnPush": false
31-
}
32-
}
28+
"aws:cdk:cloudformation:props": {}
3329
},
3430
"constructInfo": {
3531
"fqn": "@aws-cdk/aws-ecr.CfnRepository",

packages/@aws-cdk/aws-codepipeline-actions/test/pipeline-ecr-source.integ.snapshot/aws-cdk-codepipeline-ecr-source.template.json

-5
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,6 @@
354354
},
355355
"MyEcrRepo767466D0": {
356356
"Type": "AWS::ECR::Repository",
357-
"Properties": {
358-
"ImageScanningConfiguration": {
359-
"ScanOnPush": false
360-
}
361-
},
362357
"UpdateReplacePolicy": "Delete",
363358
"DeletionPolicy": "Delete"
364359
},

packages/@aws-cdk/aws-codepipeline-actions/test/pipeline-ecr-source.integ.snapshot/tree.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -574,11 +574,7 @@
574574
"path": "aws-cdk-codepipeline-ecr-source/MyEcrRepo/Resource",
575575
"attributes": {
576576
"aws:cdk:cloudformation:type": "AWS::ECR::Repository",
577-
"aws:cdk:cloudformation:props": {
578-
"imageScanningConfiguration": {
579-
"scanOnPush": false
580-
}
581-
}
577+
"aws:cdk:cloudformation:props": {}
582578
},
583579
"constructInfo": {
584580
"fqn": "@aws-cdk/aws-ecr.CfnRepository",

packages/@aws-cdk/aws-codepipeline-actions/test/pipeline-ecs-deploy.integ.snapshot/aws-cdk-codepipeline-ecs-deploy.template.json

-5
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,6 @@
215215
},
216216
"EcrRepoBB83A592": {
217217
"Type": "AWS::ECR::Repository",
218-
"Properties": {
219-
"ImageScanningConfiguration": {
220-
"ScanOnPush": false
221-
}
222-
},
223218
"UpdateReplacePolicy": "Retain",
224219
"DeletionPolicy": "Retain"
225220
},

packages/@aws-cdk/aws-codepipeline-actions/test/pipeline-ecs-deploy.integ.snapshot/tree.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,7 @@
404404
"path": "aws-cdk-codepipeline-ecs-deploy/EcrRepo/Resource",
405405
"attributes": {
406406
"aws:cdk:cloudformation:type": "AWS::ECR::Repository",
407-
"aws:cdk:cloudformation:props": {
408-
"imageScanningConfiguration": {
409-
"scanOnPush": false
410-
}
411-
}
407+
"aws:cdk:cloudformation:props": {}
412408
},
413409
"constructInfo": {
414410
"fqn": "@aws-cdk/aws-ecr.CfnRepository",

packages/@aws-cdk/aws-codepipeline-actions/test/pipeline-ecs-separate-source.lit.integ.snapshot/aws-cdk-pipeline-ecs-separate-sources.template.json

-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
"Resources": {
33
"EcsDeployRepositoryE7A569C0": {
44
"Type": "AWS::ECR::Repository",
5-
"Properties": {
6-
"ImageScanningConfiguration": {
7-
"ScanOnPush": false
8-
}
9-
},
105
"UpdateReplacePolicy": "Retain",
116
"DeletionPolicy": "Retain"
127
},

packages/@aws-cdk/aws-codepipeline-actions/test/pipeline-ecs-separate-source.lit.integ.snapshot/tree.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@
2525
"path": "aws-cdk-pipeline-ecs-separate-sources/EcsDeployRepository/Resource",
2626
"attributes": {
2727
"aws:cdk:cloudformation:type": "AWS::ECR::Repository",
28-
"aws:cdk:cloudformation:props": {
29-
"imageScanningConfiguration": {
30-
"scanOnPush": false
31-
}
32-
}
28+
"aws:cdk:cloudformation:props": {}
3329
},
3430
"constructInfo": {
3531
"fqn": "@aws-cdk/aws-ecr.CfnRepository",

packages/@aws-cdk/aws-ecr/lib/repository.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ export class Repository extends RepositoryBase {
534534
// It says "Text", but they actually mean "Object".
535535
repositoryPolicyText: Lazy.any({ produce: () => this.policyDocument }),
536536
lifecyclePolicy: Lazy.any({ produce: () => this.renderLifecyclePolicy() }),
537-
imageScanningConfiguration: props.imageScanOnPush ? { scanOnPush: true } : { scanOnPush: false },
537+
imageScanningConfiguration: props.imageScanOnPush !== undefined ? { scanOnPush: props.imageScanOnPush } : undefined,
538538
imageTagMutability: props.imageTagMutability || undefined,
539539
encryptionConfiguration: this.parseEncryption(props),
540540
});

packages/@aws-cdk/aws-ecr/test/basic.integ.snapshot/aws-ecr-integ-stack.template.json

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"Repo02AC86CF": {
44
"Type": "AWS::ECR::Repository",
55
"Properties": {
6-
"ImageScanningConfiguration": {
7-
"ScanOnPush": false
8-
},
96
"LifecyclePolicy": {
107
"LifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"selection\":{\"tagStatus\":\"any\",\"countType\":\"imageCountMoreThan\",\"countNumber\":5},\"action\":{\"type\":\"expire\"}}]}"
118
}

packages/@aws-cdk/aws-ecr/test/basic.integ.snapshot/tree.json

-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
"attributes": {
2727
"aws:cdk:cloudformation:type": "AWS::ECR::Repository",
2828
"aws:cdk:cloudformation:props": {
29-
"imageScanningConfiguration": {
30-
"scanOnPush": false
31-
},
3229
"lifecyclePolicy": {
3330
"lifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"selection\":{\"tagStatus\":\"any\",\"countType\":\"imageCountMoreThan\",\"countNumber\":5},\"action\":{\"type\":\"expire\"}}]}"
3431
}

packages/@aws-cdk/aws-ecr/test/repository.test.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ describe('repository', () => {
2020
Resources: {
2121
Repo02AC86CF: {
2222
Type: 'AWS::ECR::Repository',
23-
Properties: {
24-
ImageScanningConfiguration: {
25-
ScanOnPush: false,
26-
},
27-
},
2823
DeletionPolicy: 'Retain',
2924
UpdateReplacePolicy: 'Retain',
3025
},
@@ -34,13 +29,20 @@ describe('repository', () => {
3429

3530
test('repository creation with imageScanOnPush', () => {
3631
// GIVEN
37-
const stack = new cdk.Stack();
32+
const noScanStack = new cdk.Stack();
33+
const scanStack = new cdk.Stack();
3834

3935
// WHEN
40-
new ecr.Repository(stack, 'Repo', { imageScanOnPush: true });
36+
new ecr.Repository(noScanStack, 'NoScanRepo', { imageScanOnPush: false });
37+
new ecr.Repository(scanStack, 'ScanRepo', { imageScanOnPush: true });
4138

4239
// THEN
43-
Template.fromStack(stack).hasResourceProperties('AWS::ECR::Repository', {
40+
Template.fromStack(noScanStack).hasResourceProperties('AWS::ECR::Repository', {
41+
ImageScanningConfiguration: {
42+
ScanOnPush: false,
43+
},
44+
});
45+
Template.fromStack(scanStack).hasResourceProperties('AWS::ECR::Repository', {
4446
ImageScanningConfiguration: {
4547
ScanOnPush: true,
4648
},

packages/@aws-cdk/aws-ecs/test/ec2/ec2-task-definition.test.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,6 @@ describe('ec2 task definition', () => {
452452

453453
// THEN
454454
Template.fromStack(stack).hasResourceProperties('AWS::ECR::Repository', {
455-
ImageScanningConfiguration: {
456-
ScanOnPush: false,
457-
},
458455
LifecyclePolicy: {
459456
// eslint-disable-next-line max-len
460457
LifecyclePolicyText: '{"rules":[{"rulePriority":10,"selection":{"tagStatus":"tagged","tagPrefixList":["abc"],"countType":"imageCountMoreThan","countNumber":1},"action":{"type":"expire"}}]}',
@@ -675,11 +672,7 @@ describe('ec2 task definition', () => {
675672
});
676673

677674
// THEN
678-
Template.fromStack(stack).hasResourceProperties('AWS::ECR::Repository', {
679-
ImageScanningConfiguration: {
680-
ScanOnPush: false,
681-
},
682-
});
675+
Template.fromStack(stack).hasResourceProperties('AWS::ECR::Repository', {});
683676
});
684677

685678
test('warns when setting containers from ECR repository using fromRegistry method', () => {

packages/@aws-cdk/aws-ecs/test/external/external-task-definition.test.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,6 @@ describe('external task definition', () => {
324324

325325
// THEN
326326
Template.fromStack(stack).hasResourceProperties('AWS::ECR::Repository', {
327-
ImageScanningConfiguration: {
328-
ScanOnPush: false,
329-
},
330327
LifecyclePolicy: {
331328
// eslint-disable-next-line max-len
332329
LifecyclePolicyText: '{"rules":[{"rulePriority":10,"selection":{"tagStatus":"tagged","tagPrefixList":["abc"],"countType":"imageCountMoreThan","countNumber":1},"action":{"type":"expire"}}]}',
@@ -552,11 +549,7 @@ describe('external task definition', () => {
552549
});
553550

554551
// THEN
555-
Template.fromStack(stack).hasResourceProperties('AWS::ECR::Repository', {
556-
ImageScanningConfiguration: {
557-
ScanOnPush: false,
558-
},
559-
});
552+
Template.fromStack(stack).hasResourceProperties('AWS::ECR::Repository', {});
560553
});
561554

562555
test('warns when setting containers from ECR repository using fromRegistry method', () => {

packages/@aws-cdk/aws-lambda-event-sources/lib/stream.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import * as lambda from '@aws-cdk/aws-lambda';
22
import { Duration } from '@aws-cdk/core';
33

44
/**
5-
* The set of properties for event sources that follow the streaming model,
6-
* such as, Dynamo, Kinesis and Kafka.
5+
* The set of properties for streaming event sources shared by
6+
* Dynamo, Kinesis and Kafka.
77
*/
88
export interface BaseStreamEventSourceProps{
99
/**
@@ -21,13 +21,6 @@ export interface BaseStreamEventSourceProps{
2121
*/
2222
readonly batchSize?: number;
2323

24-
/**
25-
* An Amazon SQS queue or Amazon SNS topic destination for discarded records.
26-
*
27-
* @default discarded records are ignored
28-
*/
29-
readonly onFailure?: lambda.IEventSourceDlq;
30-
3124
/**
3225
* Where to begin consuming the stream.
3326
*/
@@ -50,8 +43,8 @@ export interface BaseStreamEventSourceProps{
5043
}
5144

5245
/**
53-
* The set of properties for event sources that follow the streaming model,
54-
* such as, Dynamo, Kinesis.
46+
* The set of properties for streaming event sources shared by
47+
* Dynamo and Kinesis.
5548
*/
5649
export interface StreamEventSourceProps extends BaseStreamEventSourceProps {
5750
/**
@@ -107,6 +100,13 @@ export interface StreamEventSourceProps extends BaseStreamEventSourceProps {
107100
* @default - None
108101
*/
109102
readonly tumblingWindow?: Duration;
103+
104+
/**
105+
* An Amazon SQS queue or Amazon SNS topic destination for discarded records.
106+
*
107+
* @default - discarded records are ignored
108+
*/
109+
readonly onFailure?: lambda.IEventSourceDlq;
110110
}
111111

112112
/**

packages/@aws-cdk/aws-lambda-python/lib/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ ARG HTTPS_PROXY
99

1010
# Upgrade pip (required by cryptography v3.4 and above, which is a dependency of poetry)
1111
RUN pip install --upgrade pip
12-
RUN pip install pipenv poetry
12+
13+
# pipenv 2022.4.8 is the last version with Python 3.6 support
14+
RUN pip install pipenv==2022.4.8 poetry
1315

1416
CMD [ "python" ]

packages/@aws-cdk/aws-lambda/lib/function.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export interface FunctionOptions extends EventInvokeConfigOptions {
9696
readonly memorySize?: number;
9797

9898
/**
99-
* The size of the function’s /tmp directory in MB.
99+
* The size of the function’s /tmp directory in MiB.
100100
*
101101
* @default 512 MiB
102102
*/

packages/@aws-cdk/aws-lambda/lib/runtime.ts

+11-6
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,31 @@ export class Runtime {
4242

4343
/**
4444
* The NodeJS runtime (nodejs)
45-
* Legacy runtime no longer supported by AWS Lambda.
45+
* @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.
4646
*/
4747
public static readonly NODEJS = new Runtime('nodejs', RuntimeFamily.NODEJS, { supportsInlineCode: true });
4848

4949
/**
5050
* The NodeJS 4.3 runtime (nodejs4.3)
51-
* Legacy runtime no longer supported by AWS Lambda.
51+
* @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.
5252
*/
5353
public static readonly NODEJS_4_3 = new Runtime('nodejs4.3', RuntimeFamily.NODEJS, { supportsInlineCode: true });
5454

5555
/**
5656
* The NodeJS 6.10 runtime (nodejs6.10)
57-
* Legacy runtime no longer supported by AWS Lambda.
57+
* @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.
5858
*/
5959
public static readonly NODEJS_6_10 = new Runtime('nodejs6.10', RuntimeFamily.NODEJS, { supportsInlineCode: true });
6060

6161
/**
6262
* The NodeJS 8.10 runtime (nodejs8.10)
63-
* Legacy runtime no longer supported by AWS Lambda.
63+
* @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.
6464
*/
6565
public static readonly NODEJS_8_10 = new Runtime('nodejs8.10', RuntimeFamily.NODEJS, { supportsInlineCode: true });
6666

6767
/**
6868
* The NodeJS 10.x runtime (nodejs10.x)
69+
* @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest NodeJS runtime.
6970
*/
7071
public static readonly NODEJS_10_X = new Runtime('nodejs10.x', RuntimeFamily.NODEJS, { supportsInlineCode: true });
7172

@@ -81,11 +82,13 @@ export class Runtime {
8182

8283
/**
8384
* The Python 2.7 runtime (python2.7)
85+
* @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.
8486
*/
8587
public static readonly PYTHON_2_7 = new Runtime('python2.7', RuntimeFamily.PYTHON, { supportsInlineCode: true });
8688

8789
/**
8890
* The Python 3.6 runtime (python3.6)
91+
* @deprecated Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Python runtime.
8992
*/
9093
public static readonly PYTHON_3_6 = new Runtime('python3.6', RuntimeFamily.PYTHON, {
9194
supportsInlineCode: true,
@@ -144,18 +147,19 @@ export class Runtime {
144147

145148
/**
146149
* The .NET Core 1.0 runtime (dotnetcore1.0)
147-
* Legacy runtime no longer supported by AWS Lambda.
150+
* Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.
148151
*/
149152
public static readonly DOTNET_CORE_1 = new Runtime('dotnetcore1.0', RuntimeFamily.DOTNET_CORE);
150153

151154
/**
152155
* The .NET Core 2.0 runtime (dotnetcore2.0)
153-
* Legacy runtime no longer supported by AWS Lambda.
156+
* Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.
154157
*/
155158
public static readonly DOTNET_CORE_2 = new Runtime('dotnetcore2.0', RuntimeFamily.DOTNET_CORE);
156159

157160
/**
158161
* The .NET Core 2.1 runtime (dotnetcore2.1)
162+
* Legacy runtime no longer supported by AWS Lambda. Migrate to the latest .NET Core runtime.
159163
*/
160164
public static readonly DOTNET_CORE_2_1 = new Runtime('dotnetcore2.1', RuntimeFamily.DOTNET_CORE);
161165

@@ -171,6 +175,7 @@ export class Runtime {
171175

172176
/**
173177
* The Ruby 2.5 runtime (ruby2.5)
178+
* Legacy runtime no longer supported by AWS Lambda. Migrate to the latest Ruby runtime.
174179
*/
175180
public static readonly RUBY_2_5 = new Runtime('ruby2.5', RuntimeFamily.RUBY);
176181

0 commit comments

Comments
 (0)