createVpcAttachment method

Future<CreateVpcAttachmentResponse> createVpcAttachment({
  1. required String coreNetworkId,
  2. required List<String> subnetArns,
  3. required String vpcArn,
  4. String? clientToken,
  5. VpcOptions? options,
  6. String? routingPolicyLabel,
  7. List<Tag>? tags,
})

Creates a VPC attachment on an edge location of a core network.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter coreNetworkId : The ID of a core network for the VPC attachment.

Parameter subnetArns : The subnet ARN of the VPC attachment.

Parameter vpcArn : The ARN of the VPC.

Parameter clientToken : The client token associated with the request.

Parameter options : Options for the VPC attachment.

Parameter routingPolicyLabel : The routing policy label to apply to the VPC attachment for traffic routing decisions.

Parameter tags : The key-value tags associated with the request.

Implementation

Future<CreateVpcAttachmentResponse> createVpcAttachment({
  required String coreNetworkId,
  required List<String> subnetArns,
  required String vpcArn,
  String? clientToken,
  VpcOptions? options,
  String? routingPolicyLabel,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'CoreNetworkId': coreNetworkId,
    'SubnetArns': subnetArns,
    'VpcArn': vpcArn,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (options != null) 'Options': options,
    if (routingPolicyLabel != null) 'RoutingPolicyLabel': routingPolicyLabel,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/vpc-attachments',
    exceptionFnMap: _exceptionFns,
  );
  return CreateVpcAttachmentResponse.fromJson(response);
}