# 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

__all__ = [
    'GetRoutingPolicyResult',
    'AwaitableGetRoutingPolicyResult',
    'get_routing_policy',
    'get_routing_policy_output',
]

@pulumi.output_type
class GetRoutingPolicyResult:
    """
    A collection of values returned by getRoutingPolicy.
    """
    def __init__(__self__, created_at=None, id=None, is_ipv6=None, name=None, organization_id=None, prefix_filter_ins=None, prefix_filter_outs=None, project_id=None, region=None, routing_policy_id=None, tags=None, updated_at=None):
        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 id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        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 prefix_filter_ins and not isinstance(prefix_filter_ins, list):
            raise TypeError("Expected argument 'prefix_filter_ins' to be a list")
        pulumi.set(__self__, "prefix_filter_ins", prefix_filter_ins)
        if prefix_filter_outs and not isinstance(prefix_filter_outs, list):
            raise TypeError("Expected argument 'prefix_filter_outs' to be a list")
        pulumi.set(__self__, "prefix_filter_outs", prefix_filter_outs)
        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 routing_policy_id and not isinstance(routing_policy_id, str):
            raise TypeError("Expected argument 'routing_policy_id' to be a str")
        pulumi.set(__self__, "routing_policy_id", routing_policy_id)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        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)

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

    @_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="isIpv6")
    def is_ipv6(self) -> _builtins.bool:
        """
        Whether the routing policy is for IPv6 prefixes.
        """
        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 routing policy is associated with.
        """
        return pulumi.get(self, "organization_id")

    @_builtins.property
    @pulumi.getter(name="prefixFilterIns")
    def prefix_filter_ins(self) -> Sequence[_builtins.str]:
        """
        List of IP prefixes accepted from the peer gateway.
        """
        return pulumi.get(self, "prefix_filter_ins")

    @_builtins.property
    @pulumi.getter(name="prefixFilterOuts")
    def prefix_filter_outs(self) -> Sequence[_builtins.str]:
        """
        List of IP prefixes advertised to the peer gateway.
        """
        return pulumi.get(self, "prefix_filter_outs")

    @_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="routingPolicyId")
    def routing_policy_id(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "routing_policy_id")

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

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


class AwaitableGetRoutingPolicyResult(GetRoutingPolicyResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetRoutingPolicyResult(
            created_at=self.created_at,
            id=self.id,
            is_ipv6=self.is_ipv6,
            name=self.name,
            organization_id=self.organization_id,
            prefix_filter_ins=self.prefix_filter_ins,
            prefix_filter_outs=self.prefix_filter_outs,
            project_id=self.project_id,
            region=self.region,
            routing_policy_id=self.routing_policy_id,
            tags=self.tags,
            updated_at=self.updated_at)


def get_routing_policy(name: Optional[_builtins.str] = None,
                       project_id: Optional[_builtins.str] = None,
                       region: Optional[_builtins.str] = None,
                       routing_policy_id: Optional[_builtins.str] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetRoutingPolicyResult:
    """
    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 routing policy ID
    my_policy = scaleway.s2svpn.get_routing_policy(routing_policy_id="11111111-1111-1111-1111-111111111111")
    ```

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Get info by name
    my_policy = scaleway.s2svpn.get_routing_policy(name="foobar")
    ```


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

    return AwaitableGetRoutingPolicyResult(
        created_at=pulumi.get(__ret__, 'created_at'),
        id=pulumi.get(__ret__, 'id'),
        is_ipv6=pulumi.get(__ret__, 'is_ipv6'),
        name=pulumi.get(__ret__, 'name'),
        organization_id=pulumi.get(__ret__, 'organization_id'),
        prefix_filter_ins=pulumi.get(__ret__, 'prefix_filter_ins'),
        prefix_filter_outs=pulumi.get(__ret__, 'prefix_filter_outs'),
        project_id=pulumi.get(__ret__, 'project_id'),
        region=pulumi.get(__ret__, 'region'),
        routing_policy_id=pulumi.get(__ret__, 'routing_policy_id'),
        tags=pulumi.get(__ret__, 'tags'),
        updated_at=pulumi.get(__ret__, 'updated_at'))
def get_routing_policy_output(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,
                              routing_policy_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                              opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetRoutingPolicyResult]:
    """
    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 routing policy ID
    my_policy = scaleway.s2svpn.get_routing_policy(routing_policy_id="11111111-1111-1111-1111-111111111111")
    ```

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Get info by name
    my_policy = scaleway.s2svpn.get_routing_policy(name="foobar")
    ```


    :param _builtins.str name: The name of the routing policy.
    :param _builtins.str project_id: The ID of the project the routing policy is associated with.
    :param _builtins.str region: `region`) The region in which the routing policy exists.
    :param _builtins.str routing_policy_id: The routing policy ID.
           
           > **Note** You must specify at least one: `name` and/or `routing_policy_id`.
    """
    __args__ = dict()
    __args__['name'] = name
    __args__['projectId'] = project_id
    __args__['region'] = region
    __args__['routingPolicyId'] = routing_policy_id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('scaleway:s2svpn/getRoutingPolicy:getRoutingPolicy', __args__, opts=opts, typ=GetRoutingPolicyResult)
    return __ret__.apply(lambda __response__: GetRoutingPolicyResult(
        created_at=pulumi.get(__response__, 'created_at'),
        id=pulumi.get(__response__, 'id'),
        is_ipv6=pulumi.get(__response__, 'is_ipv6'),
        name=pulumi.get(__response__, 'name'),
        organization_id=pulumi.get(__response__, 'organization_id'),
        prefix_filter_ins=pulumi.get(__response__, 'prefix_filter_ins'),
        prefix_filter_outs=pulumi.get(__response__, 'prefix_filter_outs'),
        project_id=pulumi.get(__response__, 'project_id'),
        region=pulumi.get(__response__, 'region'),
        routing_policy_id=pulumi.get(__response__, 'routing_policy_id'),
        tags=pulumi.get(__response__, 'tags'),
        updated_at=pulumi.get(__response__, 'updated_at')))
