Skip to content

enable_vgw_route_propagation async

enable_vgw_route_propagation(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    gateway_id: Optional[VpnGatewayId] = None,
    route_table_id: Optional[RouteTableId] = None,
    dry_run: Optional[Boolean] = None,
) -> None

Enables a virtual private gateway (VGW) to propagate routes to the specified route table of a VPC.

Parameters:

  • gateway_id (Optional[VpnGatewayId], default: None ) –

    The ID of the virtual private gateway that is attached to a VPC. The virtual private gateway must be attached to the same VPC that the routing tables are associated with.

  • route_table_id (Optional[RouteTableId], default: None ) –

    The ID of the route table. The routing table must be associated with the same VPC that the virtual private gateway is attached to.

  • 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:

Examples:

To enable route propagation This example enables the specified virtual private gateway to propagate static routes to the specified route table.

>>> await client.enable_vgw_route_propagation(route_table_id='rtb-22574640', gateway_id='vgw-9a4cacf3')
Source code in docs_src/capo_ec2/_services/async_ec2.py
async def enable_vgw_route_propagation(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    gateway_id: Optional["capo_ec2.types.vpn_gateway_id.VpnGatewayId"] = None,
    route_table_id: Optional["capo_ec2.types.route_table_id.RouteTableId"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> None:
    """<p>Enables a virtual private gateway (VGW) to propagate routes to the specified route table of a VPC.</p>

    Args:
        gateway_id: <p>The ID of the virtual private gateway that is attached to a VPC. The virtual private gateway must be attached to the same VPC that the routing tables are associated with. </p>
        route_table_id: <p>The ID of the route table. The routing table must be associated with the same VPC that the virtual private gateway is attached to. </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.

    Examples:
        To enable route propagation
        This example enables the specified virtual private gateway to propagate static routes to the specified route table.

        >>> await client.enable_vgw_route_propagation(route_table_id='rtb-22574640', gateway_id='vgw-9a4cacf3')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.enable_vgw_route_propagation_request.EnableVgwRoutePropagationRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_ec2._operations.amazon_ec2.enable_vgw_route_propagation

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.enable_vgw_route_propagation.async_enable_vgw_route_propagation(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("EnableVgwRoutePropagation")
    )
    input_: capo_ec2.types.enable_vgw_route_propagation_request.EnableVgwRoutePropagationRequest = {}
    if gateway_id is not None:
        input_["gateway_id"] = gateway_id
    if route_table_id is not None:
        input_["route_table_id"] = route_table_id
    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