Skip to content

Commit

Permalink
feat(kinesisanalytics-flink): support Apache Flink 1.20 (#31349)
Browse files Browse the repository at this point in the history
### 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*
  • Loading branch information
mazyu36 authored Sep 18, 2024
1 parent de7ab7c commit b3b9aa8
Show file tree
Hide file tree
Showing 12 changed files with 5,325 additions and 101 deletions.
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-kinesisanalytics-flink-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const flinkApp = new flink.Application(this, 'Application', {
},
},
// ...
runtime: flink.Runtime.FLINK_1_19,
runtime: flink.Runtime.FLINK_1_20,
code: flink.ApplicationCode.fromBucket(bucket, 'my-app.jar'),
});
```
Expand All @@ -59,7 +59,7 @@ snapshotting, monitoring, and parallelism.
declare const bucket: s3.Bucket;
const flinkApp = new flink.Application(this, 'Application', {
code: flink.ApplicationCode.fromBucket(bucket, 'my-app.jar'),
runtime: flink.Runtime.FLINK_1_19,
runtime: flink.Runtime.FLINK_1_20,
checkpointingEnabled: true, // default is true
checkpointInterval: Duration.seconds(30), // default is 1 minute
minPauseBetweenCheckpoints: Duration.seconds(10), // default is 5 seconds
Expand All @@ -80,7 +80,7 @@ declare const bucket: s3.Bucket;
declare const vpc: ec2.Vpc;
const flinkApp = new flink.Application(this, 'Application', {
code: flink.ApplicationCode.fromBucket(bucket, 'my-app.jar'),
runtime: flink.Runtime.FLINK_1_19,
runtime: flink.Runtime.FLINK_1_20,
vpc,
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export class Runtime {
/** Flink Version 1.19 */
public static readonly FLINK_1_19 = Runtime.of('FLINK-1_19');

/** Flink Version 1.20 */
public static readonly FLINK_1_20 = Runtime.of('FLINK-1_20');

/** Create a new Runtime with with an arbitrary Flink version string */
public static of(value: string) {
return new Runtime(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,32 @@ describe('Application', () => {
stack = new core.Stack();
bucket = new s3.Bucket(stack, 'CodeBucket');
requiredProps = {
runtime: flink.Runtime.FLINK_1_19,
runtime: flink.Runtime.FLINK_1_20,
code: flink.ApplicationCode.fromBucket(bucket, 'my-app.jar'),
};
});

test('default Flink Application', () => {
const flinkRuntimes = [
flink.Runtime.FLINK_1_6,
flink.Runtime.FLINK_1_8,
flink.Runtime.FLINK_1_11,
flink.Runtime.FLINK_1_13,
flink.Runtime.FLINK_1_15,
flink.Runtime.FLINK_1_18,
flink.Runtime.FLINK_1_19,
flink.Runtime.FLINK_1_20,
];

test.each(flinkRuntimes)('Flink Application with %s', (runtime) => {
new flink.Application(stack, 'FlinkApplication', {
runtime: flink.Runtime.FLINK_1_19,
runtime,
code: flink.ApplicationCode.fromBucket(bucket, 'my-app.jar'),
applicationName: 'MyFlinkApplication',
});

Template.fromStack(stack).hasResourceProperties('AWS::KinesisAnalyticsV2::Application', {
ApplicationName: 'MyFlinkApplication',
RuntimeEnvironment: 'FLINK-1_19',
RuntimeEnvironment: runtime.value,
ServiceExecutionRole: {
'Fn::GetAtt': [
'FlinkApplicationRole2F7BCBF6',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b3b9aa8

Please sign in to comment.