createConnectAttachment method

Future<CreateConnectAttachmentResponse> createConnectAttachment({
  1. required String coreNetworkId,
  2. required String edgeLocation,
  3. required ConnectAttachmentOptions options,
  4. required String transportAttachmentId,
  5. String? clientToken,
  6. String? routingPolicyLabel,
  7. List<Tag>? tags,
})

Creates a core network Connect attachment from a specified core network attachment.

A core network Connect attachment is a GRE-based tunnel attachment that you can use to establish a connection between a core network and an appliance. A core network Connect attachment uses an existing VPC attachment as the underlying transport mechanism.

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 where you want to create the attachment.

Parameter edgeLocation : The Region where the edge is located.

Parameter options : Options for creating an attachment.

Parameter transportAttachmentId : The ID of the attachment between the two connections.

Parameter clientToken : The client token associated with the request.

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

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

Implementation

Future<CreateConnectAttachmentResponse> createConnectAttachment({
  required String coreNetworkId,
  required String edgeLocation,
  required ConnectAttachmentOptions options,
  required String transportAttachmentId,
  String? clientToken,
  String? routingPolicyLabel,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'CoreNetworkId': coreNetworkId,
    'EdgeLocation': edgeLocation,
    'Options': options,
    'TransportAttachmentId': transportAttachmentId,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (routingPolicyLabel != null) 'RoutingPolicyLabel': routingPolicyLabel,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/connect-attachments',
    exceptionFnMap: _exceptionFns,
  );
  return CreateConnectAttachmentResponse.fromJson(response);
}