# 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__ = [
    'GetTlsStageResult',
    'AwaitableGetTlsStageResult',
    'get_tls_stage',
    'get_tls_stage_output',
]

@pulumi.output_type
class GetTlsStageResult:
    """
    A collection of values returned by getTlsStage.
    """
    def __init__(__self__, backend_stage_id=None, cache_stage_id=None, certificate_expires_at=None, created_at=None, id=None, managed_certificate=None, pipeline_id=None, project_id=None, route_stage_id=None, secret_id=None, secret_region=None, secrets=None, tls_stage_id=None, updated_at=None, waf_stage_id=None):
        if backend_stage_id and not isinstance(backend_stage_id, str):
            raise TypeError("Expected argument 'backend_stage_id' to be a str")
        pulumi.set(__self__, "backend_stage_id", backend_stage_id)
        if cache_stage_id and not isinstance(cache_stage_id, str):
            raise TypeError("Expected argument 'cache_stage_id' to be a str")
        pulumi.set(__self__, "cache_stage_id", cache_stage_id)
        if certificate_expires_at and not isinstance(certificate_expires_at, str):
            raise TypeError("Expected argument 'certificate_expires_at' to be a str")
        pulumi.set(__self__, "certificate_expires_at", certificate_expires_at)
        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 managed_certificate and not isinstance(managed_certificate, bool):
            raise TypeError("Expected argument 'managed_certificate' to be a bool")
        pulumi.set(__self__, "managed_certificate", managed_certificate)
        if pipeline_id and not isinstance(pipeline_id, str):
            raise TypeError("Expected argument 'pipeline_id' to be a str")
        pulumi.set(__self__, "pipeline_id", pipeline_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 route_stage_id and not isinstance(route_stage_id, str):
            raise TypeError("Expected argument 'route_stage_id' to be a str")
        pulumi.set(__self__, "route_stage_id", route_stage_id)
        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_region and not isinstance(secret_region, str):
            raise TypeError("Expected argument 'secret_region' to be a str")
        pulumi.set(__self__, "secret_region", secret_region)
        if secrets and not isinstance(secrets, list):
            raise TypeError("Expected argument 'secrets' to be a list")
        pulumi.set(__self__, "secrets", secrets)
        if tls_stage_id and not isinstance(tls_stage_id, str):
            raise TypeError("Expected argument 'tls_stage_id' to be a str")
        pulumi.set(__self__, "tls_stage_id", tls_stage_id)
        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 waf_stage_id and not isinstance(waf_stage_id, str):
            raise TypeError("Expected argument 'waf_stage_id' to be a str")
        pulumi.set(__self__, "waf_stage_id", waf_stage_id)

    @_builtins.property
    @pulumi.getter(name="backendStageId")
    def backend_stage_id(self) -> _builtins.str:
        return pulumi.get(self, "backend_stage_id")

    @_builtins.property
    @pulumi.getter(name="cacheStageId")
    def cache_stage_id(self) -> _builtins.str:
        return pulumi.get(self, "cache_stage_id")

    @_builtins.property
    @pulumi.getter(name="certificateExpiresAt")
    def certificate_expires_at(self) -> _builtins.str:
        return pulumi.get(self, "certificate_expires_at")

    @_builtins.property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> _builtins.str:
        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="managedCertificate")
    def managed_certificate(self) -> _builtins.bool:
        return pulumi.get(self, "managed_certificate")

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

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

    @_builtins.property
    @pulumi.getter(name="routeStageId")
    def route_stage_id(self) -> _builtins.str:
        return pulumi.get(self, "route_stage_id")

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

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

    @_builtins.property
    @pulumi.getter
    def secrets(self) -> Sequence['outputs.GetTlsStageSecretResult']:
        return pulumi.get(self, "secrets")

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

    @_builtins.property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> _builtins.str:
        return pulumi.get(self, "updated_at")

    @_builtins.property
    @pulumi.getter(name="wafStageId")
    def waf_stage_id(self) -> _builtins.str:
        return pulumi.get(self, "waf_stage_id")


class AwaitableGetTlsStageResult(GetTlsStageResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetTlsStageResult(
            backend_stage_id=self.backend_stage_id,
            cache_stage_id=self.cache_stage_id,
            certificate_expires_at=self.certificate_expires_at,
            created_at=self.created_at,
            id=self.id,
            managed_certificate=self.managed_certificate,
            pipeline_id=self.pipeline_id,
            project_id=self.project_id,
            route_stage_id=self.route_stage_id,
            secret_id=self.secret_id,
            secret_region=self.secret_region,
            secrets=self.secrets,
            tls_stage_id=self.tls_stage_id,
            updated_at=self.updated_at,
            waf_stage_id=self.waf_stage_id)


def get_tls_stage(pipeline_id: Optional[_builtins.str] = None,
                  secret_id: Optional[_builtins.str] = None,
                  secret_region: Optional[_builtins.str] = None,
                  tls_stage_id: Optional[_builtins.str] = None,
                  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetTlsStageResult:
    """
    Gets information about an Edge Services TLS stage.

    A TLS stage manages TLS/SSL certificates for an Edge Services pipeline, supporting both managed Let's Encrypt certificates and custom certificates stored in Scaleway Secret Manager.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Retrieve an Edge Services TLS stage by its ID
    by_id = scaleway.edgeservices.get_tls_stage(tls_stage_id="11111111-1111-1111-1111-111111111111")
    ```

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Retrieve an Edge Services TLS stage by pipeline ID
    by_pipeline = scaleway.edgeservices.get_tls_stage(pipeline_id=main["id"])
    ```


    :param _builtins.str pipeline_id: The ID of the pipeline.
    :param _builtins.str secret_id: Secret ID to filter for.
    :param _builtins.str secret_region: Secret region to filter for.
    :param _builtins.str tls_stage_id: The ID of the TLS stage. Conflicts with all filter arguments below.
           
           The following filter arguments are supported (cannot be used with `tls_stage_id`):
    """
    __args__ = dict()
    __args__['pipelineId'] = pipeline_id
    __args__['secretId'] = secret_id
    __args__['secretRegion'] = secret_region
    __args__['tlsStageId'] = tls_stage_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('scaleway:edgeservices/getTlsStage:getTlsStage', __args__, opts=opts, typ=GetTlsStageResult).value

    return AwaitableGetTlsStageResult(
        backend_stage_id=pulumi.get(__ret__, 'backend_stage_id'),
        cache_stage_id=pulumi.get(__ret__, 'cache_stage_id'),
        certificate_expires_at=pulumi.get(__ret__, 'certificate_expires_at'),
        created_at=pulumi.get(__ret__, 'created_at'),
        id=pulumi.get(__ret__, 'id'),
        managed_certificate=pulumi.get(__ret__, 'managed_certificate'),
        pipeline_id=pulumi.get(__ret__, 'pipeline_id'),
        project_id=pulumi.get(__ret__, 'project_id'),
        route_stage_id=pulumi.get(__ret__, 'route_stage_id'),
        secret_id=pulumi.get(__ret__, 'secret_id'),
        secret_region=pulumi.get(__ret__, 'secret_region'),
        secrets=pulumi.get(__ret__, 'secrets'),
        tls_stage_id=pulumi.get(__ret__, 'tls_stage_id'),
        updated_at=pulumi.get(__ret__, 'updated_at'),
        waf_stage_id=pulumi.get(__ret__, 'waf_stage_id'))
def get_tls_stage_output(pipeline_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                         secret_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                         secret_region: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                         tls_stage_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                         opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetTlsStageResult]:
    """
    Gets information about an Edge Services TLS stage.

    A TLS stage manages TLS/SSL certificates for an Edge Services pipeline, supporting both managed Let's Encrypt certificates and custom certificates stored in Scaleway Secret Manager.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Retrieve an Edge Services TLS stage by its ID
    by_id = scaleway.edgeservices.get_tls_stage(tls_stage_id="11111111-1111-1111-1111-111111111111")
    ```

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Retrieve an Edge Services TLS stage by pipeline ID
    by_pipeline = scaleway.edgeservices.get_tls_stage(pipeline_id=main["id"])
    ```


    :param _builtins.str pipeline_id: The ID of the pipeline.
    :param _builtins.str secret_id: Secret ID to filter for.
    :param _builtins.str secret_region: Secret region to filter for.
    :param _builtins.str tls_stage_id: The ID of the TLS stage. Conflicts with all filter arguments below.
           
           The following filter arguments are supported (cannot be used with `tls_stage_id`):
    """
    __args__ = dict()
    __args__['pipelineId'] = pipeline_id
    __args__['secretId'] = secret_id
    __args__['secretRegion'] = secret_region
    __args__['tlsStageId'] = tls_stage_id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('scaleway:edgeservices/getTlsStage:getTlsStage', __args__, opts=opts, typ=GetTlsStageResult)
    return __ret__.apply(lambda __response__: GetTlsStageResult(
        backend_stage_id=pulumi.get(__response__, 'backend_stage_id'),
        cache_stage_id=pulumi.get(__response__, 'cache_stage_id'),
        certificate_expires_at=pulumi.get(__response__, 'certificate_expires_at'),
        created_at=pulumi.get(__response__, 'created_at'),
        id=pulumi.get(__response__, 'id'),
        managed_certificate=pulumi.get(__response__, 'managed_certificate'),
        pipeline_id=pulumi.get(__response__, 'pipeline_id'),
        project_id=pulumi.get(__response__, 'project_id'),
        route_stage_id=pulumi.get(__response__, 'route_stage_id'),
        secret_id=pulumi.get(__response__, 'secret_id'),
        secret_region=pulumi.get(__response__, 'secret_region'),
        secrets=pulumi.get(__response__, 'secrets'),
        tls_stage_id=pulumi.get(__response__, 'tls_stage_id'),
        updated_at=pulumi.get(__response__, 'updated_at'),
        waf_stage_id=pulumi.get(__response__, 'waf_stage_id')))
