createVpcIngressConnection method

Future<CreateVpcIngressConnectionResponse> createVpcIngressConnection({
  1. required IngressVpcConfiguration ingressVpcConfiguration,
  2. required String serviceArn,
  3. required String vpcIngressConnectionName,
  4. List<Tag>? tags,
})

Create an App Runner VPC Ingress Connection resource. App Runner requires this resource when you want to associate your App Runner service with an Amazon VPC endpoint.

May throw InternalServiceErrorException. May throw InvalidRequestException. May throw InvalidStateException. May throw ServiceQuotaExceededException.

Parameter ingressVpcConfiguration : Specifications for the customer’s Amazon VPC and the related Amazon Web Services PrivateLink VPC endpoint that are used to create the VPC Ingress Connection resource.

Parameter serviceArn : The Amazon Resource Name (ARN) for this App Runner service that is used to create the VPC Ingress Connection resource.

Parameter vpcIngressConnectionName : A name for the VPC Ingress Connection resource. It must be unique across all the active VPC Ingress Connections in your Amazon Web Services account in the Amazon Web Services Region.

Parameter tags : An optional list of metadata items that you can associate with the VPC Ingress Connection resource. A tag is a key-value pair.

Implementation

Future<CreateVpcIngressConnectionResponse> createVpcIngressConnection({
  required IngressVpcConfiguration ingressVpcConfiguration,
  required String serviceArn,
  required String vpcIngressConnectionName,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AppRunner.CreateVpcIngressConnection'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'IngressVpcConfiguration': ingressVpcConfiguration,
      'ServiceArn': serviceArn,
      'VpcIngressConnectionName': vpcIngressConnectionName,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateVpcIngressConnectionResponse.fromJson(jsonResponse.body);
}