createVPCConnection method

Future<CreateVPCConnectionResponse> createVPCConnection({
  1. required String awsAccountId,
  2. required String name,
  3. required String roleArn,
  4. required List<String> securityGroupIds,
  5. required List<String> subnetIds,
  6. required String vPCConnectionId,
  7. List<String>? dnsResolvers,
  8. List<Tag>? tags,
})

Creates a new VPC connection.

May throw AccessDeniedException. May throw ConflictException. May throw InternalFailureException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw ResourceExistsException. May throw ThrottlingException. May throw UnsupportedUserEditionException.

Parameter awsAccountId : The Amazon Web Services account ID of the account where you want to create a new VPC connection.

Parameter name : The display name for the VPC connection.

Parameter roleArn : The IAM role to associate with the VPC connection.

Parameter securityGroupIds : A list of security group IDs for the VPC connection.

Parameter subnetIds : A list of subnet IDs for the VPC connection.

Parameter vPCConnectionId : The ID of the VPC connection that you're creating. This ID is a unique identifier for each Amazon Web Services Region in an Amazon Web Services account.

Parameter dnsResolvers : A list of IP addresses of DNS resolver endpoints for the VPC connection.

Parameter tags : A map of the key-value pairs for the resource tag or tags assigned to the VPC connection.

Implementation

Future<CreateVPCConnectionResponse> createVPCConnection({
  required String awsAccountId,
  required String name,
  required String roleArn,
  required List<String> securityGroupIds,
  required List<String> subnetIds,
  required String vPCConnectionId,
  List<String>? dnsResolvers,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'Name': name,
    'RoleArn': roleArn,
    'SecurityGroupIds': securityGroupIds,
    'SubnetIds': subnetIds,
    'VPCConnectionId': vPCConnectionId,
    if (dnsResolvers != null) 'DnsResolvers': dnsResolvers,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/vpc-connections',
    exceptionFnMap: _exceptionFns,
  );
  return CreateVPCConnectionResponse.fromJson(response);
}