Skip to content

get_vpn_connection_device_sample_configuration

get_vpn_connection_device_sample_configuration(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    vpn_connection_id: Optional[VpnConnectionId] = None,
    vpn_connection_device_type_id: Optional[VpnConnectionDeviceTypeId] = None,
    internet_key_exchange_version: Optional[String] = None,
    sample_type: Optional[String] = None,
    dry_run: Optional[Boolean] = None,
) -> GetVpnConnectionDeviceSampleConfigurationResult

Download an Amazon Web Services-provided sample configuration file to be used with the customer gateway device specified for your Site-to-Site VPN connection.

Parameters:

  • vpn_connection_id (Optional[VpnConnectionId], default: None ) –

    The VpnConnectionId specifies the Site-to-Site VPN connection used for the sample configuration.

  • vpn_connection_device_type_id (Optional[VpnConnectionDeviceTypeId], default: None ) –

    Device identifier provided by the GetVpnConnectionDeviceTypes API.

  • internet_key_exchange_version (Optional[String], default: None ) –

    The IKE version to be used in the sample configuration file for your customer gateway device. You can specify one of the following versions: ikev1 or ikev2.

  • sample_type (Optional[String], default: None ) –

    The type of sample configuration to generate. Valid values are "compatibility" (includes IKEv1) or "recommended" (throws UnsupportedOperationException for IKEv1).

  • 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 get_vpn_connection_device_sample_configuration(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    vpn_connection_id: Optional[
        "capo_ec2.types.vpn_connection_id.VpnConnectionId"
    ] = None,
    vpn_connection_device_type_id: Optional[
        "capo_ec2.types.vpn_connection_device_type_id.VpnConnectionDeviceTypeId"
    ] = None,
    internet_key_exchange_version: Optional["capo_ec2.types.string.String"] = None,
    sample_type: Optional["capo_ec2.types.string.String"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.get_vpn_connection_device_sample_configuration_result.GetVpnConnectionDeviceSampleConfigurationResult":
    """<p>Download an Amazon Web Services-provided sample configuration file to be used with the customer gateway device specified for your Site-to-Site VPN connection.</p>

    Args:
        vpn_connection_id: <p>The <code>VpnConnectionId</code> specifies the Site-to-Site VPN connection used for the sample configuration.</p>
        vpn_connection_device_type_id: <p>Device identifier provided by the <code>GetVpnConnectionDeviceTypes</code> API.</p>
        internet_key_exchange_version: <p>The IKE version to be used in the sample configuration file for your customer gateway device. You can specify one of the following versions: <code>ikev1</code> or <code>ikev2</code>.</p>
        sample_type: <p>The type of sample configuration to generate. Valid values are "compatibility" (includes IKEv1) or "recommended" (throws UnsupportedOperationException for IKEv1).</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.get_vpn_connection_device_sample_configuration_request.GetVpnConnectionDeviceSampleConfigurationRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.get_vpn_connection_device_sample_configuration_result.GetVpnConnectionDeviceSampleConfigurationResult"
    ]:
        import capo_ec2._operations.amazon_ec2.get_vpn_connection_device_sample_configuration

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

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

        return capo_ec2.types.get_vpn_connection_device_sample_configuration_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetVpnConnectionDeviceSampleConfiguration",
            redact_output=_redact_output,
        ),
    )
    input_: capo_ec2.types.get_vpn_connection_device_sample_configuration_request.GetVpnConnectionDeviceSampleConfigurationRequest = {}
    if vpn_connection_id is not None:
        input_["vpn_connection_id"] = vpn_connection_id
    if vpn_connection_device_type_id is not None:
        input_["vpn_connection_device_type_id"] = vpn_connection_device_type_id
    if internet_key_exchange_version is not None:
        input_["internet_key_exchange_version"] = internet_key_exchange_version
    if sample_type is not None:
        input_["sample_type"] = sample_type
    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