# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs

__all__ = [
    'GetConnectionResult',
    'AwaitableGetConnectionResult',
    'get_connection',
    'get_connection_output',
]

@pulumi.output_type
class GetConnectionResult:
    """
    A collection of values returned by getConnection.
    """
    def __init__(__self__, bgp_config_ipv4s=None, bgp_config_ipv6s=None, bgp_session_ipv4s=None, bgp_session_ipv6s=None, bgp_status_ipv4=None, bgp_status_ipv6=None, connection_id=None, created_at=None, customer_gateway_id=None, enable_route_propagation=None, esp_ciphers=None, id=None, ikev2_ciphers=None, initiation_policy=None, is_ipv6=None, name=None, organization_id=None, project_id=None, region=None, route_propagation_enabled=None, secret_id=None, secret_version=None, status=None, tags=None, tunnel_status=None, updated_at=None, vpn_gateway_id=None):
        if bgp_config_ipv4s and not isinstance(bgp_config_ipv4s, list):
            raise TypeError("Expected argument 'bgp_config_ipv4s' to be a list")
        pulumi.set(__self__, "bgp_config_ipv4s", bgp_config_ipv4s)
        if bgp_config_ipv6s and not isinstance(bgp_config_ipv6s, list):
            raise TypeError("Expected argument 'bgp_config_ipv6s' to be a list")
        pulumi.set(__self__, "bgp_config_ipv6s", bgp_config_ipv6s)
        if bgp_session_ipv4s and not isinstance(bgp_session_ipv4s, list):
            raise TypeError("Expected argument 'bgp_session_ipv4s' to be a list")
        pulumi.set(__self__, "bgp_session_ipv4s", bgp_session_ipv4s)
        if bgp_session_ipv6s and not isinstance(bgp_session_ipv6s, list):
            raise TypeError("Expected argument 'bgp_session_ipv6s' to be a list")
        pulumi.set(__self__, "bgp_session_ipv6s", bgp_session_ipv6s)
        if bgp_status_ipv4 and not isinstance(bgp_status_ipv4, str):
            raise TypeError("Expected argument 'bgp_status_ipv4' to be a str")
        pulumi.set(__self__, "bgp_status_ipv4", bgp_status_ipv4)
        if bgp_status_ipv6 and not isinstance(bgp_status_ipv6, str):
            raise TypeError("Expected argument 'bgp_status_ipv6' to be a str")
        pulumi.set(__self__, "bgp_status_ipv6", bgp_status_ipv6)
        if connection_id and not isinstance(connection_id, str):
            raise TypeError("Expected argument 'connection_id' to be a str")
        pulumi.set(__self__, "connection_id", connection_id)
        if created_at and not isinstance(created_at, str):
            raise TypeError("Expected argument 'created_at' to be a str")
        pulumi.set(__self__, "created_at", created_at)
        if customer_gateway_id and not isinstance(customer_gateway_id, str):
            raise TypeError("Expected argument 'customer_gateway_id' to be a str")
        pulumi.set(__self__, "customer_gateway_id", customer_gateway_id)
        if enable_route_propagation and not isinstance(enable_route_propagation, bool):
            raise TypeError("Expected argument 'enable_route_propagation' to be a bool")
        pulumi.set(__self__, "enable_route_propagation", enable_route_propagation)
        if esp_ciphers and not isinstance(esp_ciphers, list):
            raise TypeError("Expected argument 'esp_ciphers' to be a list")
        pulumi.set(__self__, "esp_ciphers", esp_ciphers)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ikev2_ciphers and not isinstance(ikev2_ciphers, list):
            raise TypeError("Expected argument 'ikev2_ciphers' to be a list")
        pulumi.set(__self__, "ikev2_ciphers", ikev2_ciphers)
        if initiation_policy and not isinstance(initiation_policy, str):
            raise TypeError("Expected argument 'initiation_policy' to be a str")
        pulumi.set(__self__, "initiation_policy", initiation_policy)
        if is_ipv6 and not isinstance(is_ipv6, bool):
            raise TypeError("Expected argument 'is_ipv6' to be a bool")
        pulumi.set(__self__, "is_ipv6", is_ipv6)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if organization_id and not isinstance(organization_id, str):
            raise TypeError("Expected argument 'organization_id' to be a str")
        pulumi.set(__self__, "organization_id", organization_id)
        if project_id and not isinstance(project_id, str):
            raise TypeError("Expected argument 'project_id' to be a str")
        pulumi.set(__self__, "project_id", project_id)
        if region and not isinstance(region, str):
            raise TypeError("Expected argument 'region' to be a str")
        pulumi.set(__self__, "region", region)
        if route_propagation_enabled and not isinstance(route_propagation_enabled, bool):
            raise TypeError("Expected argument 'route_propagation_enabled' to be a bool")
        pulumi.set(__self__, "route_propagation_enabled", route_propagation_enabled)
        if secret_id and not isinstance(secret_id, str):
            raise TypeError("Expected argument 'secret_id' to be a str")
        pulumi.set(__self__, "secret_id", secret_id)
        if secret_version and not isinstance(secret_version, int):
            raise TypeError("Expected argument 'secret_version' to be a int")
        pulumi.set(__self__, "secret_version", secret_version)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if tunnel_status and not isinstance(tunnel_status, str):
            raise TypeError("Expected argument 'tunnel_status' to be a str")
        pulumi.set(__self__, "tunnel_status", tunnel_status)
        if updated_at and not isinstance(updated_at, str):
            raise TypeError("Expected argument 'updated_at' to be a str")
        pulumi.set(__self__, "updated_at", updated_at)
        if vpn_gateway_id and not isinstance(vpn_gateway_id, str):
            raise TypeError("Expected argument 'vpn_gateway_id' to be a str")
        pulumi.set(__self__, "vpn_gateway_id", vpn_gateway_id)

    @_builtins.property
    @pulumi.getter(name="bgpConfigIpv4s")
    def bgp_config_ipv4s(self) -> Sequence['outputs.GetConnectionBgpConfigIpv4Result']:
        """
        The BGP IPv4 configuration.
        """
        return pulumi.get(self, "bgp_config_ipv4s")

    @_builtins.property
    @pulumi.getter(name="bgpConfigIpv6s")
    def bgp_config_ipv6s(self) -> Sequence['outputs.GetConnectionBgpConfigIpv6Result']:
        """
        The BGP IPv6 configuration.
        """
        return pulumi.get(self, "bgp_config_ipv6s")

    @_builtins.property
    @pulumi.getter(name="bgpSessionIpv4s")
    def bgp_session_ipv4s(self) -> Sequence['outputs.GetConnectionBgpSessionIpv4Result']:
        """
        The BGP IPv4 session information.
        """
        return pulumi.get(self, "bgp_session_ipv4s")

    @_builtins.property
    @pulumi.getter(name="bgpSessionIpv6s")
    def bgp_session_ipv6s(self) -> Sequence['outputs.GetConnectionBgpSessionIpv6Result']:
        """
        The BGP IPv6 session information.
        """
        return pulumi.get(self, "bgp_session_ipv6s")

    @_builtins.property
    @pulumi.getter(name="bgpStatusIpv4")
    def bgp_status_ipv4(self) -> _builtins.str:
        """
        The status of the BGP IPv4 session.
        """
        return pulumi.get(self, "bgp_status_ipv4")

    @_builtins.property
    @pulumi.getter(name="bgpStatusIpv6")
    def bgp_status_ipv6(self) -> _builtins.str:
        """
        The status of the BGP IPv6 session.
        """
        return pulumi.get(self, "bgp_status_ipv6")

    @_builtins.property
    @pulumi.getter(name="connectionId")
    def connection_id(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "connection_id")

    @_builtins.property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> _builtins.str:
        """
        The date and time of creation of the connection.
        """
        return pulumi.get(self, "created_at")

    @_builtins.property
    @pulumi.getter(name="customerGatewayId")
    def customer_gateway_id(self) -> _builtins.str:
        """
        The ID of the customer gateway attached to the connection.
        """
        return pulumi.get(self, "customer_gateway_id")

    @_builtins.property
    @pulumi.getter(name="enableRoutePropagation")
    def enable_route_propagation(self) -> _builtins.bool:
        """
        Whether route propagation is enabled.
        """
        return pulumi.get(self, "enable_route_propagation")

    @_builtins.property
    @pulumi.getter(name="espCiphers")
    def esp_ciphers(self) -> Sequence['outputs.GetConnectionEspCipherResult']:
        """
        The ESP ciphers configuration.
        """
        return pulumi.get(self, "esp_ciphers")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter(name="ikev2Ciphers")
    def ikev2_ciphers(self) -> Sequence['outputs.GetConnectionIkev2CipherResult']:
        """
        The IKEv2 ciphers configuration.
        """
        return pulumi.get(self, "ikev2_ciphers")

    @_builtins.property
    @pulumi.getter(name="initiationPolicy")
    def initiation_policy(self) -> _builtins.str:
        """
        Who initiates the IPSec tunnel.
        """
        return pulumi.get(self, "initiation_policy")

    @_builtins.property
    @pulumi.getter(name="isIpv6")
    def is_ipv6(self) -> _builtins.bool:
        """
        Whether the IPSec tunnel uses IPv6.
        """
        return pulumi.get(self, "is_ipv6")

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="organizationId")
    def organization_id(self) -> _builtins.str:
        """
        The Organization ID the connection is associated with.
        """
        return pulumi.get(self, "organization_id")

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "project_id")

    @_builtins.property
    @pulumi.getter
    def region(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "region")

    @_builtins.property
    @pulumi.getter(name="routePropagationEnabled")
    def route_propagation_enabled(self) -> _builtins.bool:
        """
        Whether route propagation is currently enabled.
        """
        return pulumi.get(self, "route_propagation_enabled")

    @_builtins.property
    @pulumi.getter(name="secretId")
    def secret_id(self) -> _builtins.str:
        """
        The ID of the secret containing the pre-shared key (PSK).
        """
        return pulumi.get(self, "secret_id")

    @_builtins.property
    @pulumi.getter(name="secretVersion")
    def secret_version(self) -> _builtins.int:
        """
        The version of the secret containing the PSK.
        """
        return pulumi.get(self, "secret_version")

    @_builtins.property
    @pulumi.getter
    def status(self) -> _builtins.str:
        """
        The status of the connection.
        """
        return pulumi.get(self, "status")

    @_builtins.property
    @pulumi.getter
    def tags(self) -> Sequence[_builtins.str]:
        """
        The tags associated with the connection.
        """
        return pulumi.get(self, "tags")

    @_builtins.property
    @pulumi.getter(name="tunnelStatus")
    def tunnel_status(self) -> _builtins.str:
        """
        The status of the IPSec tunnel.
        """
        return pulumi.get(self, "tunnel_status")

    @_builtins.property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> _builtins.str:
        """
        The date and time of the last update of the connection.
        """
        return pulumi.get(self, "updated_at")

    @_builtins.property
    @pulumi.getter(name="vpnGatewayId")
    def vpn_gateway_id(self) -> _builtins.str:
        """
        The ID of the VPN gateway attached to the connection.
        """
        return pulumi.get(self, "vpn_gateway_id")


class AwaitableGetConnectionResult(GetConnectionResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetConnectionResult(
            bgp_config_ipv4s=self.bgp_config_ipv4s,
            bgp_config_ipv6s=self.bgp_config_ipv6s,
            bgp_session_ipv4s=self.bgp_session_ipv4s,
            bgp_session_ipv6s=self.bgp_session_ipv6s,
            bgp_status_ipv4=self.bgp_status_ipv4,
            bgp_status_ipv6=self.bgp_status_ipv6,
            connection_id=self.connection_id,
            created_at=self.created_at,
            customer_gateway_id=self.customer_gateway_id,
            enable_route_propagation=self.enable_route_propagation,
            esp_ciphers=self.esp_ciphers,
            id=self.id,
            ikev2_ciphers=self.ikev2_ciphers,
            initiation_policy=self.initiation_policy,
            is_ipv6=self.is_ipv6,
            name=self.name,
            organization_id=self.organization_id,
            project_id=self.project_id,
            region=self.region,
            route_propagation_enabled=self.route_propagation_enabled,
            secret_id=self.secret_id,
            secret_version=self.secret_version,
            status=self.status,
            tags=self.tags,
            tunnel_status=self.tunnel_status,
            updated_at=self.updated_at,
            vpn_gateway_id=self.vpn_gateway_id)


def get_connection(connection_id: Optional[_builtins.str] = None,
                   name: Optional[_builtins.str] = None,
                   project_id: Optional[_builtins.str] = None,
                   region: Optional[_builtins.str] = None,
                   opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetConnectionResult:
    """
    For further information refer to the Site-to-Site VPN [API documentation](https://www.scaleway.com/en/developers/api/site-to-site-vpn/).

    ## Example Usage

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Get info by connection ID
    my_connection = scaleway.s2svpn.get_connection(connection_id="11111111-1111-1111-1111-111111111111")
    ```

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Get info by name
    my_connection = scaleway.s2svpn.get_connection(name="foobar")
    ```


    :param _builtins.str connection_id: The connection ID.
           
           > **Note** You must specify at least one: `name` and/or `connection_id`.
    :param _builtins.str name: The name of the connection.
    :param _builtins.str project_id: The ID of the project the connection is associated with.
    :param _builtins.str region: `region`) The region in which the connection exists.
    """
    __args__ = dict()
    __args__['connectionId'] = connection_id
    __args__['name'] = name
    __args__['projectId'] = project_id
    __args__['region'] = region
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('scaleway:s2svpn/getConnection:getConnection', __args__, opts=opts, typ=GetConnectionResult).value

    return AwaitableGetConnectionResult(
        bgp_config_ipv4s=pulumi.get(__ret__, 'bgp_config_ipv4s'),
        bgp_config_ipv6s=pulumi.get(__ret__, 'bgp_config_ipv6s'),
        bgp_session_ipv4s=pulumi.get(__ret__, 'bgp_session_ipv4s'),
        bgp_session_ipv6s=pulumi.get(__ret__, 'bgp_session_ipv6s'),
        bgp_status_ipv4=pulumi.get(__ret__, 'bgp_status_ipv4'),
        bgp_status_ipv6=pulumi.get(__ret__, 'bgp_status_ipv6'),
        connection_id=pulumi.get(__ret__, 'connection_id'),
        created_at=pulumi.get(__ret__, 'created_at'),
        customer_gateway_id=pulumi.get(__ret__, 'customer_gateway_id'),
        enable_route_propagation=pulumi.get(__ret__, 'enable_route_propagation'),
        esp_ciphers=pulumi.get(__ret__, 'esp_ciphers'),
        id=pulumi.get(__ret__, 'id'),
        ikev2_ciphers=pulumi.get(__ret__, 'ikev2_ciphers'),
        initiation_policy=pulumi.get(__ret__, 'initiation_policy'),
        is_ipv6=pulumi.get(__ret__, 'is_ipv6'),
        name=pulumi.get(__ret__, 'name'),
        organization_id=pulumi.get(__ret__, 'organization_id'),
        project_id=pulumi.get(__ret__, 'project_id'),
        region=pulumi.get(__ret__, 'region'),
        route_propagation_enabled=pulumi.get(__ret__, 'route_propagation_enabled'),
        secret_id=pulumi.get(__ret__, 'secret_id'),
        secret_version=pulumi.get(__ret__, 'secret_version'),
        status=pulumi.get(__ret__, 'status'),
        tags=pulumi.get(__ret__, 'tags'),
        tunnel_status=pulumi.get(__ret__, 'tunnel_status'),
        updated_at=pulumi.get(__ret__, 'updated_at'),
        vpn_gateway_id=pulumi.get(__ret__, 'vpn_gateway_id'))
def get_connection_output(connection_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                          name: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                          project_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                          region: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                          opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetConnectionResult]:
    """
    For further information refer to the Site-to-Site VPN [API documentation](https://www.scaleway.com/en/developers/api/site-to-site-vpn/).

    ## Example Usage

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Get info by connection ID
    my_connection = scaleway.s2svpn.get_connection(connection_id="11111111-1111-1111-1111-111111111111")
    ```

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Get info by name
    my_connection = scaleway.s2svpn.get_connection(name="foobar")
    ```


    :param _builtins.str connection_id: The connection ID.
           
           > **Note** You must specify at least one: `name` and/or `connection_id`.
    :param _builtins.str name: The name of the connection.
    :param _builtins.str project_id: The ID of the project the connection is associated with.
    :param _builtins.str region: `region`) The region in which the connection exists.
    """
    __args__ = dict()
    __args__['connectionId'] = connection_id
    __args__['name'] = name
    __args__['projectId'] = project_id
    __args__['region'] = region
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('scaleway:s2svpn/getConnection:getConnection', __args__, opts=opts, typ=GetConnectionResult)
    return __ret__.apply(lambda __response__: GetConnectionResult(
        bgp_config_ipv4s=pulumi.get(__response__, 'bgp_config_ipv4s'),
        bgp_config_ipv6s=pulumi.get(__response__, 'bgp_config_ipv6s'),
        bgp_session_ipv4s=pulumi.get(__response__, 'bgp_session_ipv4s'),
        bgp_session_ipv6s=pulumi.get(__response__, 'bgp_session_ipv6s'),
        bgp_status_ipv4=pulumi.get(__response__, 'bgp_status_ipv4'),
        bgp_status_ipv6=pulumi.get(__response__, 'bgp_status_ipv6'),
        connection_id=pulumi.get(__response__, 'connection_id'),
        created_at=pulumi.get(__response__, 'created_at'),
        customer_gateway_id=pulumi.get(__response__, 'customer_gateway_id'),
        enable_route_propagation=pulumi.get(__response__, 'enable_route_propagation'),
        esp_ciphers=pulumi.get(__response__, 'esp_ciphers'),
        id=pulumi.get(__response__, 'id'),
        ikev2_ciphers=pulumi.get(__response__, 'ikev2_ciphers'),
        initiation_policy=pulumi.get(__response__, 'initiation_policy'),
        is_ipv6=pulumi.get(__response__, 'is_ipv6'),
        name=pulumi.get(__response__, 'name'),
        organization_id=pulumi.get(__response__, 'organization_id'),
        project_id=pulumi.get(__response__, 'project_id'),
        region=pulumi.get(__response__, 'region'),
        route_propagation_enabled=pulumi.get(__response__, 'route_propagation_enabled'),
        secret_id=pulumi.get(__response__, 'secret_id'),
        secret_version=pulumi.get(__response__, 'secret_version'),
        status=pulumi.get(__response__, 'status'),
        tags=pulumi.get(__response__, 'tags'),
        tunnel_status=pulumi.get(__response__, 'tunnel_status'),
        updated_at=pulumi.get(__response__, 'updated_at'),
        vpn_gateway_id=pulumi.get(__response__, 'vpn_gateway_id')))
