Managed Service for Apache Flink VPC API - Managed Service for Apache Flink
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

Amazon Managed Service for Apache Flink 之前称为 Amazon Kinesis Data Analytics for Apache Flink。

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

Managed Service for Apache Flink VPC API

使用以下 Managed Service for Apache Flink API 操作来管理应用程序的 VPC。有关使用 Managed Service for Apache Flink API 的信息,请参阅适用于 Apache 的托管服务 Flink API 示例代码

创建应用程序

在创建过程中,使用CreateApplication操作向您的应用程序添加 VPC 配置。

CreateApplication 操作的以下示例请求代码在创建应用程序时包括 VPC 配置:

{ "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:::mybucket", "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

在创建 VPC 配置后,使用AddApplicationVpcConfiguration操作将其添加到您的应用程序中。

AddApplicationVpcConfiguration 操作的以下示例请求代码将 VPC 配置添加到现有应用程序中:

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

DeleteApplicationVpcConfiguration

使用DeleteApplicationVpcConfiguration操作从您的应用程序中删除 VPC 配置。

AddApplicationVpcConfiguration 操作的以下示例请求代码从应用程序中删除现有的 VPC 配置:

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

更新应用程序

使用UpdateApplication操作一次性更新应用程序的所有 VPC 配置。

UpdateApplication 操作的以下示例请求代码更新应用程序的所有 VPC 配置:

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