Exports routes from the specified transit gateway route table to the specified S3 bucket. By default, all routes are exported. Alternatively, you can filter by CIDR range.
The routes are saved to the specified bucket in a JSON file. For more information, see Export route tables to Amazon S3 in the Amazon Web Services Transit Gateways Guide.
Parameters:
-
transit_gateway_route_table_id
(Optional[TransitGatewayRouteTableId], default:
None
)
–
The ID of the route table.
-
filters
(Optional[FilterList], default:
None
)
–
One or more filters. The possible values are:
-
attachment.transit-gateway-attachment-id - The id of the transit gateway attachment.
-
attachment.resource-id - The resource id of the transit gateway attachment.
-
route-search.exact-match - The exact match of the specified filter.
-
route-search.longest-prefix-match - The longest prefix that matches the route.
-
route-search.subnet-of-match - The routes with a subnet that match the specified CIDR filter.
-
route-search.supernet-of-match - The routes with a CIDR that encompass the CIDR filter. For example, if you have 10.0.1.0/29 and 10.0.1.0/31 routes in your route table and you specify supernet-of-match as 10.0.1.0/30, then the result returns 10.0.1.0/29.
-
state - The state of the route (active | blackhole).
-
transit-gateway-route-destination-cidr-block - The CIDR range.
-
type - The type of route (propagated | static).
-
s3_bucket
(Optional[String], default:
None
)
–
The name of the S3 bucket.
-
dry_run
(Optional[Boolean], default:
None
)
–
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
Raises:
Source code in docs_src/capo_ec2/_services/async_ec2.py
| async def export_transit_gateway_routes(
self,
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
transit_gateway_route_table_id: Optional[
"capo_ec2.types.transit_gateway_route_table_id.TransitGatewayRouteTableId"
] = None,
filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
s3_bucket: Optional["capo_ec2.types.string.String"] = None,
dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.export_transit_gateway_routes_result.ExportTransitGatewayRoutesResult":
"""<p>Exports routes from the specified transit gateway route table to the specified S3 bucket. By default, all routes are exported. Alternatively, you can filter by CIDR range.</p> <p>The routes are saved to the specified bucket in a JSON file. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#tgw-export-route-tables">Export route tables to Amazon S3</a> in the <i>Amazon Web Services Transit Gateways Guide</i>.</p>
Args:
transit_gateway_route_table_id: <p>The ID of the route table.</p>
filters: <p>One or more filters. The possible values are:</p> <ul> <li> <p> <code>attachment.transit-gateway-attachment-id</code> - The id of the transit gateway attachment.</p> </li> <li> <p> <code>attachment.resource-id</code> - The resource id of the transit gateway attachment.</p> </li> <li> <p> <code>route-search.exact-match</code> - The exact match of the specified filter.</p> </li> <li> <p> <code>route-search.longest-prefix-match</code> - The longest prefix that matches the route.</p> </li> <li> <p> <code>route-search.subnet-of-match</code> - The routes with a subnet that match the specified CIDR filter.</p> </li> <li> <p> <code>route-search.supernet-of-match</code> - The routes with a CIDR that encompass the CIDR filter. For example, if you have 10.0.1.0/29 and 10.0.1.0/31 routes in your route table and you specify supernet-of-match as 10.0.1.0/30, then the result returns 10.0.1.0/29.</p> </li> <li> <p> <code>state</code> - The state of the route (<code>active</code> | <code>blackhole</code>).</p> </li> <li> <p> <code>transit-gateway-route-destination-cidr-block</code> - The CIDR range.</p> </li> <li> <p> <code>type</code> - The type of route (<code>propagated</code> | <code>static</code>).</p> </li> </ul>
s3_bucket: <p>The name of the S3 bucket.</p>
dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
Raises:
capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_ec2.types.export_transit_gateway_routes_request.ExportTransitGatewayRoutesRequest]",
) -> AsyncOperationResponse[
"capo_ec2.types.export_transit_gateway_routes_result.ExportTransitGatewayRoutesResult"
]:
import capo_ec2._operations.amazon_ec2.export_transit_gateway_routes
(
output,
http_response,
) = await capo_ec2._operations.amazon_ec2.export_transit_gateway_routes.async_export_transit_gateway_routes(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ExportTransitGatewayRoutes")
)
input_: capo_ec2.types.export_transit_gateway_routes_request.ExportTransitGatewayRoutesRequest = {}
if transit_gateway_route_table_id is not None:
input_["transit_gateway_route_table_id"] = transit_gateway_route_table_id
if filters is not None:
input_["filters"] = filters
if s3_bucket is not None:
input_["s3_bucket"] = s3_bucket
if dry_run is not None:
input_["dry_run"] = dry_run
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|