View a markdown version of this page

Use the Managed Service for Apache Flink VPC API - Managed Service for Apache Flink

Use the Managed Service for Apache Flink VPC API

Use the following Managed Service for Apache Flink API operations to manage VPCs for your application. For information on using the Managed Service for Apache Flink API, see Managed Service for Apache Flink API example code.

Create application

Use the CreateApplication action to add a VPC configuration to your application during creation.

The following example request code for the CreateApplication action includes a VPC configuration when the application is created:

{ "ApplicationName":"MyApplication", "ApplicationDescription":"My-Application-Description", "RuntimeEnvironment":"FLINK-1_15", "ServiceExecutionRole":"arn:aws:iam::123456789123:role/myrole", "ApplicationConfiguration": { "ApplicationCodeConfiguration":{ "CodeContent":{ "S3ContentLocation":{ "BucketARN":"arn:aws:s3:::amzn-s3-demo-bucket", "FileKey":"myflink.jar", "ObjectVersion":"AbCdEfGhIjKlMnOpQrStUvWxYz12345" } }, "CodeContentType":"ZIPFILE" }, "FlinkApplicationConfiguration":{ "ParallelismConfiguration":{ "ConfigurationType":"CUSTOM", "Parallelism":2, "ParallelismPerKPU":1, "AutoScalingEnabled":true } }, "VpcConfigurations": [ { "SecurityGroupIds": [ "sg-0123456789abcdef0" ], "SubnetIds": [ "subnet-0123456789abcdef0" ] } ] } }

AddApplicationVpcConfiguration

Use the AddApplicationVpcConfiguration action to add a VPC configuration to your application after it has been created.

The following example request code for the AddApplicationVpcConfiguration action adds a VPC configuration to an existing application:

{ "ApplicationName": "MyApplication", "CurrentApplicationVersionId": 9, "VpcConfiguration": { "SecurityGroupIds": [ "sg-0123456789abcdef0" ], "SubnetIds": [ "subnet-0123456789abcdef0" ] } }
Note

If the application is RUNNING in enhanced snapshot mode and SnapshotsEnabled is true, Managed Service for Apache Flink creates a system snapshot. The caller of AddApplicationVpcConfiguration needs kinesisanalytics:CreateSystemSnapshot on the application ARN. For more information, see System snapshots.

DeleteApplicationVpcConfiguration

Use the DeleteApplicationVpcConfiguration action to remove a VPC configuration from your application.

The following example request code for the AddApplicationVpcConfiguration action removes an existing VPC configuration from an application:

{ "ApplicationName": "MyApplication", "CurrentApplicationVersionId": 9, "VpcConfigurationId": "1.1" }
Note

If the application is RUNNING in enhanced snapshot mode and SnapshotsEnabled is true, Managed Service for Apache Flink creates a system snapshot. The caller of DeleteApplicationVpcConfiguration needs kinesisanalytics:CreateSystemSnapshot on the application ARN. For more information, see System snapshots.

Update application

Use the UpdateApplication action to update all of an application's VPC configurations at once.

The following example request code for the UpdateApplication action updates all of the VPC configurations for an application:

{ "ApplicationConfigurationUpdate": { "VpcConfigurationUpdates": [ { "SecurityGroupIdUpdates": [ "sg-0123456789abcdef0" ], "SubnetIdUpdates": [ "subnet-0123456789abcdef0" ], "VpcConfigurationId": "2.1" } ] }, "ApplicationName": "MyApplication", "CurrentApplicationVersionId": 9 }