addApplicationVpcConfiguration method

Future<AddApplicationVpcConfigurationResponse> addApplicationVpcConfiguration({
  1. required String applicationName,
  2. required int currentApplicationVersionId,
  3. required VpcConfiguration vpcConfiguration,
})

Adds a Virtual Private Cloud (VPC) configuration to the application. Applications can use VPCs to store and access resources securely.

Note the following about VPC configurations for Kinesis Data Analytics applications:

  • VPC configurations are not supported for SQL applications.
  • When a VPC is added to a Kinesis Data Analytics application, the application can no longer be accessed from the Internet directly. To enable Internet access to the application, add an Internet gateway to your VPC.

May throw ResourceNotFoundException. May throw ResourceInUseException. May throw InvalidArgumentException. May throw ConcurrentModificationException. May throw InvalidApplicationConfigurationException.

Parameter applicationName : The name of an existing application.

Parameter currentApplicationVersionId : The version of the application to which you want to add the VPC configuration. You can use the DescribeApplication operation to get the current application version. If the version specified is not the current version, the ConcurrentModificationException is returned.

Parameter vpcConfiguration : Description of the VPC to add to the application.

Implementation

Future<AddApplicationVpcConfigurationResponse>
    addApplicationVpcConfiguration({
  required String applicationName,
  required int currentApplicationVersionId,
  required VpcConfiguration vpcConfiguration,
}) async {
  ArgumentError.checkNotNull(applicationName, 'applicationName');
  _s.validateStringLength(
    'applicationName',
    applicationName,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(
      currentApplicationVersionId, 'currentApplicationVersionId');
  _s.validateNumRange(
    'currentApplicationVersionId',
    currentApplicationVersionId,
    1,
    999999999,
    isRequired: true,
  );
  ArgumentError.checkNotNull(vpcConfiguration, 'vpcConfiguration');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'KinesisAnalytics_20180523.AddApplicationVpcConfiguration'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ApplicationName': applicationName,
      'CurrentApplicationVersionId': currentApplicationVersionId,
      'VpcConfiguration': vpcConfiguration,
    },
  );

  return AddApplicationVpcConfigurationResponse.fromJson(jsonResponse.body);
}