# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities

__all__ = ['ServiceCertificateArgs', 'ServiceCertificate']

@pulumi.input_type
class ServiceCertificateArgs:
    def __init__(__self__, *,
                 cert: pulumi.Input[str],
                 key: pulumi.Input[str],
                 certificate_name: Optional[pulumi.Input[str]] = None,
                 lang: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a ServiceCertificate resource.
        :param pulumi.Input[str] cert: Cert of the Certificate in which the Certificate will add.
        :param pulumi.Input[str] key: Key of the Certificate in which the Certificate will add.
        :param pulumi.Input[str] certificate_name: Name of the Certificate. 
               This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-",
               and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time.
               Suffix .sh and .tel are not supported.
               **NOTE:** One of `certificate_name` and `name` must be specified.
        :param pulumi.Input[str] lang: The lang.
        :param pulumi.Input[str] name: It has been deprecated from version 1.129.0 and using `certificate_name` instead.
        """
        pulumi.set(__self__, "cert", cert)
        pulumi.set(__self__, "key", key)
        if certificate_name is not None:
            pulumi.set(__self__, "certificate_name", certificate_name)
        if lang is not None:
            pulumi.set(__self__, "lang", lang)
        if name is not None:
            warnings.warn("""attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.""", DeprecationWarning)
            pulumi.log.warn("""name is deprecated: attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.""")
        if name is not None:
            pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter
    def cert(self) -> pulumi.Input[str]:
        """
        Cert of the Certificate in which the Certificate will add.
        """
        return pulumi.get(self, "cert")

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

    @property
    @pulumi.getter
    def key(self) -> pulumi.Input[str]:
        """
        Key of the Certificate in which the Certificate will add.
        """
        return pulumi.get(self, "key")

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

    @property
    @pulumi.getter(name="certificateName")
    def certificate_name(self) -> Optional[pulumi.Input[str]]:
        """
        Name of the Certificate. 
        This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-",
        and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time.
        Suffix .sh and .tel are not supported.
        **NOTE:** One of `certificate_name` and `name` must be specified.
        """
        return pulumi.get(self, "certificate_name")

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

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

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        It has been deprecated from version 1.129.0 and using `certificate_name` instead.
        """
        return pulumi.get(self, "name")

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


@pulumi.input_type
class _ServiceCertificateState:
    def __init__(__self__, *,
                 cert: Optional[pulumi.Input[str]] = None,
                 certificate_name: Optional[pulumi.Input[str]] = None,
                 key: Optional[pulumi.Input[str]] = None,
                 lang: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering ServiceCertificate resources.
        :param pulumi.Input[str] cert: Cert of the Certificate in which the Certificate will add.
        :param pulumi.Input[str] certificate_name: Name of the Certificate. 
               This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-",
               and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time.
               Suffix .sh and .tel are not supported.
               **NOTE:** One of `certificate_name` and `name` must be specified.
        :param pulumi.Input[str] key: Key of the Certificate in which the Certificate will add.
        :param pulumi.Input[str] lang: The lang.
        :param pulumi.Input[str] name: It has been deprecated from version 1.129.0 and using `certificate_name` instead.
        """
        if cert is not None:
            pulumi.set(__self__, "cert", cert)
        if certificate_name is not None:
            pulumi.set(__self__, "certificate_name", certificate_name)
        if key is not None:
            pulumi.set(__self__, "key", key)
        if lang is not None:
            pulumi.set(__self__, "lang", lang)
        if name is not None:
            warnings.warn("""attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.""", DeprecationWarning)
            pulumi.log.warn("""name is deprecated: attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.""")
        if name is not None:
            pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter
    def cert(self) -> Optional[pulumi.Input[str]]:
        """
        Cert of the Certificate in which the Certificate will add.
        """
        return pulumi.get(self, "cert")

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

    @property
    @pulumi.getter(name="certificateName")
    def certificate_name(self) -> Optional[pulumi.Input[str]]:
        """
        Name of the Certificate. 
        This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-",
        and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time.
        Suffix .sh and .tel are not supported.
        **NOTE:** One of `certificate_name` and `name` must be specified.
        """
        return pulumi.get(self, "certificate_name")

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

    @property
    @pulumi.getter
    def key(self) -> Optional[pulumi.Input[str]]:
        """
        Key of the Certificate in which the Certificate will add.
        """
        return pulumi.get(self, "key")

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

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

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        It has been deprecated from version 1.129.0 and using `certificate_name` instead.
        """
        return pulumi.get(self, "name")

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


class ServiceCertificate(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cert: Optional[pulumi.Input[str]] = None,
                 certificate_name: Optional[pulumi.Input[str]] = None,
                 key: Optional[pulumi.Input[str]] = None,
                 lang: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Provides a SSL Certificates Certificate resource.

        For information about SSL Certificates Certificate and how to use it, see [What is Certificate](https://www.alibabacloud.com/help/product/28533.html).

        > **NOTE:** Available in v1.129.0+.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        example = alicloud.cas.ServiceCertificate("example",
            certificate_name="test",
            cert=(lambda path: open(path).read())(f"{path['module']}/test.crt"),
            key=(lambda path: open(path).read())(f"{path['module']}/test.key"))
        ```

        ## Import

        SSL Certificates Certificate can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:cas/serviceCertificate:ServiceCertificate example <id>
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] cert: Cert of the Certificate in which the Certificate will add.
        :param pulumi.Input[str] certificate_name: Name of the Certificate. 
               This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-",
               and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time.
               Suffix .sh and .tel are not supported.
               **NOTE:** One of `certificate_name` and `name` must be specified.
        :param pulumi.Input[str] key: Key of the Certificate in which the Certificate will add.
        :param pulumi.Input[str] lang: The lang.
        :param pulumi.Input[str] name: It has been deprecated from version 1.129.0 and using `certificate_name` instead.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ServiceCertificateArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Provides a SSL Certificates Certificate resource.

        For information about SSL Certificates Certificate and how to use it, see [What is Certificate](https://www.alibabacloud.com/help/product/28533.html).

        > **NOTE:** Available in v1.129.0+.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        example = alicloud.cas.ServiceCertificate("example",
            certificate_name="test",
            cert=(lambda path: open(path).read())(f"{path['module']}/test.crt"),
            key=(lambda path: open(path).read())(f"{path['module']}/test.key"))
        ```

        ## Import

        SSL Certificates Certificate can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:cas/serviceCertificate:ServiceCertificate example <id>
        ```

        :param str resource_name: The name of the resource.
        :param ServiceCertificateArgs 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(ServiceCertificateArgs, 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,
                 cert: Optional[pulumi.Input[str]] = None,
                 certificate_name: Optional[pulumi.Input[str]] = None,
                 key: Optional[pulumi.Input[str]] = None,
                 lang: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[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__ = ServiceCertificateArgs.__new__(ServiceCertificateArgs)

            if cert is None and not opts.urn:
                raise TypeError("Missing required property 'cert'")
            __props__.__dict__["cert"] = cert
            __props__.__dict__["certificate_name"] = certificate_name
            if key is None and not opts.urn:
                raise TypeError("Missing required property 'key'")
            __props__.__dict__["key"] = key
            __props__.__dict__["lang"] = lang
            if name is not None and not opts.urn:
                warnings.warn("""attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.""", DeprecationWarning)
                pulumi.log.warn("""name is deprecated: attribute 'name' has been deprecated from provider version 1.129.0 and it will be remove in the future version. Please use the new attribute 'certificate_name' instead.""")
            __props__.__dict__["name"] = name
        super(ServiceCertificate, __self__).__init__(
            'alicloud:cas/serviceCertificate:ServiceCertificate',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            cert: Optional[pulumi.Input[str]] = None,
            certificate_name: Optional[pulumi.Input[str]] = None,
            key: Optional[pulumi.Input[str]] = None,
            lang: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None) -> 'ServiceCertificate':
        """
        Get an existing ServiceCertificate 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[str] cert: Cert of the Certificate in which the Certificate will add.
        :param pulumi.Input[str] certificate_name: Name of the Certificate. 
               This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-",
               and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time.
               Suffix .sh and .tel are not supported.
               **NOTE:** One of `certificate_name` and `name` must be specified.
        :param pulumi.Input[str] key: Key of the Certificate in which the Certificate will add.
        :param pulumi.Input[str] lang: The lang.
        :param pulumi.Input[str] name: It has been deprecated from version 1.129.0 and using `certificate_name` instead.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ServiceCertificateState.__new__(_ServiceCertificateState)

        __props__.__dict__["cert"] = cert
        __props__.__dict__["certificate_name"] = certificate_name
        __props__.__dict__["key"] = key
        __props__.__dict__["lang"] = lang
        __props__.__dict__["name"] = name
        return ServiceCertificate(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def cert(self) -> pulumi.Output[str]:
        """
        Cert of the Certificate in which the Certificate will add.
        """
        return pulumi.get(self, "cert")

    @property
    @pulumi.getter(name="certificateName")
    def certificate_name(self) -> pulumi.Output[str]:
        """
        Name of the Certificate. 
        This name without suffix can have a string of 1 to 63 characters, must contain only alphanumeric characters or "-",
        and must not begin or end with "-", and "-" must not in the 3th and 4th character positions at the same time.
        Suffix .sh and .tel are not supported.
        **NOTE:** One of `certificate_name` and `name` must be specified.
        """
        return pulumi.get(self, "certificate_name")

    @property
    @pulumi.getter
    def key(self) -> pulumi.Output[str]:
        """
        Key of the Certificate in which the Certificate will add.
        """
        return pulumi.get(self, "key")

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

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        It has been deprecated from version 1.129.0 and using `certificate_name` instead.
        """
        return pulumi.get(self, "name")

