Skip to content

Commit b3b9aa8

Browse files
authored
feat(kinesisanalytics-flink): support Apache Flink 1.20 (#31349)
### Issue # (if applicable) N/A ### Reason for this change Support new runtime. Ref: https://aws.amazon.com/about-aws/whats-new/2024/09/amazon-managed-service-apache-flink-1-20/ ### Description of changes * Add Flink 1.20 to enum * Improve unit tests and integ test to test all runtime versions ### Description of how you validated changes Ran improved 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 de7ab7c commit b3b9aa8

12 files changed

+5325
-101
lines changed

packages/@aws-cdk/aws-kinesisanalytics-flink-alpha/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const flinkApp = new flink.Application(this, 'Application', {
4646
},
4747
},
4848
// ...
49-
runtime: flink.Runtime.FLINK_1_19,
49+
runtime: flink.Runtime.FLINK_1_20,
5050
code: flink.ApplicationCode.fromBucket(bucket, 'my-app.jar'),
5151
});
5252
```
@@ -59,7 +59,7 @@ snapshotting, monitoring, and parallelism.
5959
declare const bucket: s3.Bucket;
6060
const flinkApp = new flink.Application(this, 'Application', {
6161
code: flink.ApplicationCode.fromBucket(bucket, 'my-app.jar'),
62-
runtime: flink.Runtime.FLINK_1_19,
62+
runtime: flink.Runtime.FLINK_1_20,
6363
checkpointingEnabled: true, // default is true
6464
checkpointInterval: Duration.seconds(30), // default is 1 minute
6565
minPauseBetweenCheckpoints: Duration.seconds(10), // default is 5 seconds
@@ -80,7 +80,7 @@ declare const bucket: s3.Bucket;
8080
declare const vpc: ec2.Vpc;
8181
const flinkApp = new flink.Application(this, 'Application', {
8282
code: flink.ApplicationCode.fromBucket(bucket, 'my-app.jar'),
83-
runtime: flink.Runtime.FLINK_1_19,
83+
runtime: flink.Runtime.FLINK_1_20,
8484
vpc,
8585
});
8686
```

packages/@aws-cdk/aws-kinesisanalytics-flink-alpha/lib/types.ts

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ export class Runtime {
7272
/** Flink Version 1.19 */
7373
public static readonly FLINK_1_19 = Runtime.of('FLINK-1_19');
7474

75+
/** Flink Version 1.20 */
76+
public static readonly FLINK_1_20 = Runtime.of('FLINK-1_20');
77+
7578
/** Create a new Runtime with with an arbitrary Flink version string */
7679
public static of(value: string) {
7780
return new Runtime(value);

packages/@aws-cdk/aws-kinesisanalytics-flink-alpha/test/application.test.ts

+15-4
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,32 @@ describe('Application', () => {
2121
stack = new core.Stack();
2222
bucket = new s3.Bucket(stack, 'CodeBucket');
2323
requiredProps = {
24-
runtime: flink.Runtime.FLINK_1_19,
24+
runtime: flink.Runtime.FLINK_1_20,
2525
code: flink.ApplicationCode.fromBucket(bucket, 'my-app.jar'),
2626
};
2727
});
2828

29-
test('default Flink Application', () => {
29+
const flinkRuntimes = [
30+
flink.Runtime.FLINK_1_6,
31+
flink.Runtime.FLINK_1_8,
32+
flink.Runtime.FLINK_1_11,
33+
flink.Runtime.FLINK_1_13,
34+
flink.Runtime.FLINK_1_15,
35+
flink.Runtime.FLINK_1_18,
36+
flink.Runtime.FLINK_1_19,
37+
flink.Runtime.FLINK_1_20,
38+
];
39+
40+
test.each(flinkRuntimes)('Flink Application with %s', (runtime) => {
3041
new flink.Application(stack, 'FlinkApplication', {
31-
runtime: flink.Runtime.FLINK_1_19,
42+
runtime,
3243
code: flink.ApplicationCode.fromBucket(bucket, 'my-app.jar'),
3344
applicationName: 'MyFlinkApplication',
3445
});
3546

3647
Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', {
3748
ApplicationName: 'MyFlinkApplication',
38-
RuntimeEnvironment: 'FLINK-1_19',
49+
RuntimeEnvironment: runtime.value,
3950
ServiceExecutionRole: {
4051
'Fn::GetAtt': [
4152
'FlinkApplicationRole2F7BCBF6',

packages/@aws-cdk/aws-kinesisanalytics-flink-alpha/test/integ.application.lit.js.snapshot/ApplicationTestDefaultTestDeployAssertF9C5F731.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/aws-kinesisanalytics-flink-alpha/test/integ.application.lit.js.snapshot/ApplicationTestDefaultTestDeployAssertF9C5F731.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/aws-kinesisanalytics-flink-alpha/test/integ.application.lit.js.snapshot/FlinkAppTest.assets.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)