createTransitGatewayRouteTableAttachment method

Future<CreateTransitGatewayRouteTableAttachmentResponse> createTransitGatewayRouteTableAttachment({
  1. required String peeringId,
  2. required String transitGatewayRouteTableArn,
  3. String? clientToken,
  4. String? routingPolicyLabel,
  5. List<Tag>? tags,
})

Creates a transit gateway route table attachment.

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

Parameter peeringId : The ID of the peer for the

Parameter transitGatewayRouteTableArn : The ARN of the transit gateway route table for the attachment request. For example, "TransitGatewayRouteTableArn": "arn:aws:ec2:us-west-2:123456789012:transit-gateway-route-table/tgw-rtb-9876543210123456".

Parameter clientToken : The client token associated with the request.

Parameter routingPolicyLabel : The routing policy label to apply to the Transit Gateway route table attachment for traffic routing decisions.

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

Implementation

Future<CreateTransitGatewayRouteTableAttachmentResponse>
    createTransitGatewayRouteTableAttachment({
  required String peeringId,
  required String transitGatewayRouteTableArn,
  String? clientToken,
  String? routingPolicyLabel,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'PeeringId': peeringId,
    'TransitGatewayRouteTableArn': transitGatewayRouteTableArn,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (routingPolicyLabel != null) 'RoutingPolicyLabel': routingPolicyLabel,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/transit-gateway-route-table-attachments',
    exceptionFnMap: _exceptionFns,
  );
  return CreateTransitGatewayRouteTableAttachmentResponse.fromJson(response);
}