# 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__ = ['CustomCertificateArgs', 'CustomCertificate']

@pulumi.input_type
class CustomCertificateArgs:
    def __init__(__self__, *,
                 certificate: pulumi.Input[_builtins.str],
                 certificate_authority_certificate: pulumi.Input[_builtins.str],
                 private_key: pulumi.Input[_builtins.str],
                 team_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a CustomCertificate resource.
        :param pulumi.Input[_builtins.str] certificate: The certificate itself. Should be in PEM format.
        :param pulumi.Input[_builtins.str] certificate_authority_certificate: The Certificate Authority root certificate such as one of Let's Encrypt's ISRG root certificates. This will be provided by your certificate issuer and is different to the core certificate. This may be included in their download process or available for download on their website. Should be in PEM format.
        :param pulumi.Input[_builtins.str] private_key: The private key of the Certificate. Should be in PEM format.
        :param pulumi.Input[_builtins.str] team_id: The ID of the team the Custom Certificate should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        """
        pulumi.set(__self__, "certificate", certificate)
        pulumi.set(__self__, "certificate_authority_certificate", certificate_authority_certificate)
        pulumi.set(__self__, "private_key", private_key)
        if team_id is not None:
            pulumi.set(__self__, "team_id", team_id)

    @_builtins.property
    @pulumi.getter
    def certificate(self) -> pulumi.Input[_builtins.str]:
        """
        The certificate itself. Should be in PEM format.
        """
        return pulumi.get(self, "certificate")

    @certificate.setter
    def certificate(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "certificate", value)

    @_builtins.property
    @pulumi.getter(name="certificateAuthorityCertificate")
    def certificate_authority_certificate(self) -> pulumi.Input[_builtins.str]:
        """
        The Certificate Authority root certificate such as one of Let's Encrypt's ISRG root certificates. This will be provided by your certificate issuer and is different to the core certificate. This may be included in their download process or available for download on their website. Should be in PEM format.
        """
        return pulumi.get(self, "certificate_authority_certificate")

    @certificate_authority_certificate.setter
    def certificate_authority_certificate(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "certificate_authority_certificate", value)

    @_builtins.property
    @pulumi.getter(name="privateKey")
    def private_key(self) -> pulumi.Input[_builtins.str]:
        """
        The private key of the Certificate. Should be in PEM format.
        """
        return pulumi.get(self, "private_key")

    @private_key.setter
    def private_key(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "private_key", value)

    @_builtins.property
    @pulumi.getter(name="teamId")
    def team_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the team the Custom Certificate should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        """
        return pulumi.get(self, "team_id")

    @team_id.setter
    def team_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "team_id", value)


@pulumi.input_type
class _CustomCertificateState:
    def __init__(__self__, *,
                 certificate: Optional[pulumi.Input[_builtins.str]] = None,
                 certificate_authority_certificate: Optional[pulumi.Input[_builtins.str]] = None,
                 private_key: Optional[pulumi.Input[_builtins.str]] = None,
                 team_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering CustomCertificate resources.
        :param pulumi.Input[_builtins.str] certificate: The certificate itself. Should be in PEM format.
        :param pulumi.Input[_builtins.str] certificate_authority_certificate: The Certificate Authority root certificate such as one of Let's Encrypt's ISRG root certificates. This will be provided by your certificate issuer and is different to the core certificate. This may be included in their download process or available for download on their website. Should be in PEM format.
        :param pulumi.Input[_builtins.str] private_key: The private key of the Certificate. Should be in PEM format.
        :param pulumi.Input[_builtins.str] team_id: The ID of the team the Custom Certificate should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        """
        if certificate is not None:
            pulumi.set(__self__, "certificate", certificate)
        if certificate_authority_certificate is not None:
            pulumi.set(__self__, "certificate_authority_certificate", certificate_authority_certificate)
        if private_key is not None:
            pulumi.set(__self__, "private_key", private_key)
        if team_id is not None:
            pulumi.set(__self__, "team_id", team_id)

    @_builtins.property
    @pulumi.getter
    def certificate(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The certificate itself. Should be in PEM format.
        """
        return pulumi.get(self, "certificate")

    @certificate.setter
    def certificate(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "certificate", value)

    @_builtins.property
    @pulumi.getter(name="certificateAuthorityCertificate")
    def certificate_authority_certificate(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The Certificate Authority root certificate such as one of Let's Encrypt's ISRG root certificates. This will be provided by your certificate issuer and is different to the core certificate. This may be included in their download process or available for download on their website. Should be in PEM format.
        """
        return pulumi.get(self, "certificate_authority_certificate")

    @certificate_authority_certificate.setter
    def certificate_authority_certificate(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "certificate_authority_certificate", value)

    @_builtins.property
    @pulumi.getter(name="privateKey")
    def private_key(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The private key of the Certificate. Should be in PEM format.
        """
        return pulumi.get(self, "private_key")

    @private_key.setter
    def private_key(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "private_key", value)

    @_builtins.property
    @pulumi.getter(name="teamId")
    def team_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the team the Custom Certificate should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        """
        return pulumi.get(self, "team_id")

    @team_id.setter
    def team_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "team_id", value)


@pulumi.type_token("vercel:index/customCertificate:CustomCertificate")
class CustomCertificate(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 certificate: Optional[pulumi.Input[_builtins.str]] = None,
                 certificate_authority_certificate: Optional[pulumi.Input[_builtins.str]] = None,
                 private_key: Optional[pulumi.Input[_builtins.str]] = None,
                 team_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Provides a Custom Certificate Resource, allowing Custom Certificates to be uploaded to Vercel.

        By default, Vercel provides all domains with a custom SSL certificates. However, Enterprise teams can upload their own custom SSL certificate.

        For more detailed information, please see the [Vercel documentation](https://vercel.com/docs/domains/custom-SSL-certificate).

        ## Example Usage

        ```python
        import pulumi
        import pulumi_std as std
        import pulumiverse_vercel as vercel

        example = vercel.CustomCertificate("example",
            private_key=std.index.file(input="private.key")["result"],
            certificate=std.index.file(input="certificate.crt")["result"],
            certificate_authority_certificate=std.index.file(input="ca.crt")["result"])
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] certificate: The certificate itself. Should be in PEM format.
        :param pulumi.Input[_builtins.str] certificate_authority_certificate: The Certificate Authority root certificate such as one of Let's Encrypt's ISRG root certificates. This will be provided by your certificate issuer and is different to the core certificate. This may be included in their download process or available for download on their website. Should be in PEM format.
        :param pulumi.Input[_builtins.str] private_key: The private key of the Certificate. Should be in PEM format.
        :param pulumi.Input[_builtins.str] team_id: The ID of the team the Custom Certificate should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: CustomCertificateArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Provides a Custom Certificate Resource, allowing Custom Certificates to be uploaded to Vercel.

        By default, Vercel provides all domains with a custom SSL certificates. However, Enterprise teams can upload their own custom SSL certificate.

        For more detailed information, please see the [Vercel documentation](https://vercel.com/docs/domains/custom-SSL-certificate).

        ## Example Usage

        ```python
        import pulumi
        import pulumi_std as std
        import pulumiverse_vercel as vercel

        example = vercel.CustomCertificate("example",
            private_key=std.index.file(input="private.key")["result"],
            certificate=std.index.file(input="certificate.crt")["result"],
            certificate_authority_certificate=std.index.file(input="ca.crt")["result"])
        ```

        :param str resource_name: The name of the resource.
        :param CustomCertificateArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(CustomCertificateArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 certificate: Optional[pulumi.Input[_builtins.str]] = None,
                 certificate_authority_certificate: Optional[pulumi.Input[_builtins.str]] = None,
                 private_key: Optional[pulumi.Input[_builtins.str]] = None,
                 team_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = CustomCertificateArgs.__new__(CustomCertificateArgs)

            if certificate is None and not opts.urn:
                raise TypeError("Missing required property 'certificate'")
            __props__.__dict__["certificate"] = certificate
            if certificate_authority_certificate is None and not opts.urn:
                raise TypeError("Missing required property 'certificate_authority_certificate'")
            __props__.__dict__["certificate_authority_certificate"] = certificate_authority_certificate
            if private_key is None and not opts.urn:
                raise TypeError("Missing required property 'private_key'")
            __props__.__dict__["private_key"] = None if private_key is None else pulumi.Output.secret(private_key)
            __props__.__dict__["team_id"] = team_id
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["privateKey"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(CustomCertificate, __self__).__init__(
            'vercel:index/customCertificate:CustomCertificate',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            certificate: Optional[pulumi.Input[_builtins.str]] = None,
            certificate_authority_certificate: Optional[pulumi.Input[_builtins.str]] = None,
            private_key: Optional[pulumi.Input[_builtins.str]] = None,
            team_id: Optional[pulumi.Input[_builtins.str]] = None) -> 'CustomCertificate':
        """
        Get an existing CustomCertificate resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] certificate: The certificate itself. Should be in PEM format.
        :param pulumi.Input[_builtins.str] certificate_authority_certificate: The Certificate Authority root certificate such as one of Let's Encrypt's ISRG root certificates. This will be provided by your certificate issuer and is different to the core certificate. This may be included in their download process or available for download on their website. Should be in PEM format.
        :param pulumi.Input[_builtins.str] private_key: The private key of the Certificate. Should be in PEM format.
        :param pulumi.Input[_builtins.str] team_id: The ID of the team the Custom Certificate should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _CustomCertificateState.__new__(_CustomCertificateState)

        __props__.__dict__["certificate"] = certificate
        __props__.__dict__["certificate_authority_certificate"] = certificate_authority_certificate
        __props__.__dict__["private_key"] = private_key
        __props__.__dict__["team_id"] = team_id
        return CustomCertificate(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter
    def certificate(self) -> pulumi.Output[_builtins.str]:
        """
        The certificate itself. Should be in PEM format.
        """
        return pulumi.get(self, "certificate")

    @_builtins.property
    @pulumi.getter(name="certificateAuthorityCertificate")
    def certificate_authority_certificate(self) -> pulumi.Output[_builtins.str]:
        """
        The Certificate Authority root certificate such as one of Let's Encrypt's ISRG root certificates. This will be provided by your certificate issuer and is different to the core certificate. This may be included in their download process or available for download on their website. Should be in PEM format.
        """
        return pulumi.get(self, "certificate_authority_certificate")

    @_builtins.property
    @pulumi.getter(name="privateKey")
    def private_key(self) -> pulumi.Output[_builtins.str]:
        """
        The private key of the Certificate. Should be in PEM format.
        """
        return pulumi.get(self, "private_key")

    @_builtins.property
    @pulumi.getter(name="teamId")
    def team_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID of the team the Custom Certificate should exist under. Required when configuring a team resource if a default team has not been set in the provider.
        """
        return pulumi.get(self, "team_id")

