Skip to content

describe_customer_gateways

describe_customer_gateways(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    customer_gateway_ids: Optional[CustomerGatewayIdStringList] = None,
    filters: Optional[FilterList] = None,
    dry_run: Optional[Boolean] = None,
) -> DescribeCustomerGatewaysResult

Describes one or more of your VPN customer gateways.

For more information, see Amazon Web Services Site-to-Site VPN in the Amazon Web Services Site-to-Site VPN User Guide.

Parameters:

  • customer_gateway_ids (Optional[CustomerGatewayIdStringList], default: None ) –

    One or more customer gateway IDs.

    Default: Describes all your customer gateways.

  • filters (Optional[FilterList], default: None ) –

    One or more filters.

    • bgp-asn - The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).

    • customer-gateway-id - The ID of the customer gateway.

    • ip-address - The IP address of the customer gateway device's external interface.

    • state - The state of the customer gateway (pending | available | deleting | deleted).

    • type - The type of customer gateway. Currently, the only supported type is ipsec.1.

    • tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    • tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

  • 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 describe a customer gateway This example describes the specified customer gateway.

>>> client.describe_customer_gateways(customer_gateway_ids=['cgw-0e11f167'])
Source code in docs_src/capo_ec2/_services/ec2.py
def describe_customer_gateways(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    customer_gateway_ids: Optional[
        "capo_ec2.types.customer_gateway_id_string_list.CustomerGatewayIdStringList"
    ] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.describe_customer_gateways_result.DescribeCustomerGatewaysResult":
    """<p>Describes one or more of your VPN customer gateways.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html">Amazon Web Services Site-to-Site VPN</a> in the <i>Amazon Web Services Site-to-Site VPN User Guide</i>.</p>

    Args:
        customer_gateway_ids: <p>One or more customer gateway IDs.</p> <p>Default: Describes all your customer gateways.</p>
        filters: <p>One or more filters.</p> <ul> <li> <p> <code>bgp-asn</code> - The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).</p> </li> <li> <p> <code>customer-gateway-id</code> - The ID of the customer gateway.</p> </li> <li> <p> <code>ip-address</code> - The IP address of the customer gateway device's external interface.</p> </li> <li> <p> <code>state</code> - The state of the customer gateway (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p> </li> <li> <p> <code>type</code> - The type of customer gateway. Currently, the only supported type is <code>ipsec.1</code>.</p> </li> <li> <p> <code>tag</code>:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p> </li> <li> <p> <code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p> </li> </ul>
        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 describe a customer gateway
        This example describes the specified customer gateway.

        >>> client.describe_customer_gateways(customer_gateway_ids=['cgw-0e11f167'])
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_customer_gateways_request.DescribeCustomerGatewaysRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_customer_gateways_result.DescribeCustomerGatewaysResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_customer_gateways

        output, http_response = (
            capo_ec2._operations.amazon_ec2.describe_customer_gateways.describe_customer_gateways(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeCustomerGateways")
    )
    input_: capo_ec2.types.describe_customer_gateways_request.DescribeCustomerGatewaysRequest = {}
    if customer_gateway_ids is not None:
        input_["customer_gateway_ids"] = customer_gateway_ids
    if filters is not None:
        input_["filters"] = filters
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output