Skip to content

describe_vpn_connections

describe_vpn_connections(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    filters: Optional[FilterList] = None,
    vpn_connection_ids: Optional[VpnConnectionIdStringList] = None,
    dry_run: Optional[Boolean] = None,
) -> DescribeVpnConnectionsResult

Describes one or more of your VPN connections.

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

Parameters:

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

    One or more filters.

    • customer-gateway-configuration - The configuration information for the customer gateway.

    • customer-gateway-id - The ID of a customer gateway associated with the VPN connection.

    • state - The state of the VPN connection (pending | available | deleting | deleted).

    • option.static-routes-only - Indicates whether the connection has static routes only. Used for devices that do not support Border Gateway Protocol (BGP).

    • route.destination-cidr-block - The destination CIDR block. This corresponds to the subnet used in a customer data center.

    • bgp-asn - The BGP Autonomous System Number (ASN) associated with a BGP device.

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

    • type - The type of VPN connection. Currently the only supported type is ipsec.1.

    • vpn-connection-id - The ID of the VPN connection.

    • vpn-gateway-id - The ID of a virtual private gateway associated with the VPN connection.

    • transit-gateway-id - The ID of a transit gateway associated with the VPN connection.

  • vpn_connection_ids (Optional[VpnConnectionIdStringList], default: None ) –

    One or more VPN connection IDs.

    Default: Describes your VPN connections.

  • 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/ec2.py
def describe_vpn_connections(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    vpn_connection_ids: Optional[
        "capo_ec2.types.vpn_connection_id_string_list.VpnConnectionIdStringList"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.describe_vpn_connections_result.DescribeVpnConnectionsResult":
    """<p>Describes one or more of your VPN connections.</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:
        filters: <p>One or more filters.</p> <ul> <li> <p> <code>customer-gateway-configuration</code> - The configuration information for the customer gateway.</p> </li> <li> <p> <code>customer-gateway-id</code> - The ID of a customer gateway associated with the VPN connection.</p> </li> <li> <p> <code>state</code> - The state of the VPN connection (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p> </li> <li> <p> <code>option.static-routes-only</code> - Indicates whether the connection has static routes only. Used for devices that do not support Border Gateway Protocol (BGP).</p> </li> <li> <p> <code>route.destination-cidr-block</code> - The destination CIDR block. This corresponds to the subnet used in a customer data center.</p> </li> <li> <p> <code>bgp-asn</code> - The BGP Autonomous System Number (ASN) associated with a BGP device.</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> <li> <p> <code>type</code> - The type of VPN connection. Currently the only supported type is <code>ipsec.1</code>.</p> </li> <li> <p> <code>vpn-connection-id</code> - The ID of the VPN connection.</p> </li> <li> <p> <code>vpn-gateway-id</code> - The ID of a virtual private gateway associated with the VPN connection.</p> </li> <li> <p> <code>transit-gateway-id</code> - The ID of a transit gateway associated with the VPN connection.</p> </li> </ul>
        vpn_connection_ids: <p>One or more VPN connection IDs.</p> <p>Default: Describes your VPN connections.</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.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_vpn_connections_request.DescribeVpnConnectionsRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_vpn_connections_result.DescribeVpnConnectionsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_vpn_connections

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

    def _redact_output(
        output: "capo_ec2.types.describe_vpn_connections_result.DescribeVpnConnectionsResult",
    ) -> dict[str, Any]:
        import capo_ec2.types.describe_vpn_connections_result

        return capo_ec2.types.describe_vpn_connections_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DescribeVpnConnections", redact_output=_redact_output),
    )
    input_: capo_ec2.types.describe_vpn_connections_request.DescribeVpnConnectionsRequest = {}
    if filters is not None:
        input_["filters"] = filters
    if vpn_connection_ids is not None:
        input_["vpn_connection_ids"] = vpn_connection_ids
    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