# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class Domain(pulumi.CustomResource):
    auth_config: pulumi.Output[dict]
    """
    The auth config of the accelerated domain.

      * `auth_type` (`str`) - Auth type of the auth config. Valid values are  `no_auth`, `type_a`, `type_b` and `type_c`. Default value is `no_auth`.
      * `masterKey` (`str`) - Master authentication key of the auth config. This parameter can have a string of 6 to 32 characters and must contain only alphanumeric characters.
      * `slaveKey` (`str`) - Slave authentication key of the auth config. This parameter can have a string of 6 to 32 characters and must contain only alphanumeric characters.
      * `timeout` (`float`) - Authentication cache time of the auth config. Default value is `1800`. It's value is valid only when the `auth_type` is `type_b` or `type_c`.
    """
    block_ips: pulumi.Output[list]
    cache_configs: pulumi.Output[list]
    """
    The cache configs of the accelerated domain.

      * `cacheContent` (`str`) - Cache content of the cache config. It's value is a path string when the `cache_type` is `path`. When the `cache_type` is `suffix`, it's value is a string which contains multiple file suffixes separated by commas.
      * `cacheId` (`str`)
      * `cacheType` (`str`) - Cache type of the cache config. Valid values are `suffix` and `path`.
      * `ttl` (`float`) - Cache time of the cache config.
      * `weight` (`float`) - Weight of the cache config. This parameter's value is between 1 and 99. Default value is `1`. The higher the value, the higher the priority.
    """
    cdn_type: pulumi.Output[str]
    """
    Cdn type of the accelerated domain. Valid values are `web`, `download`, `video`, `liveStream`.
    """
    certificate_config: pulumi.Output[dict]
    domain_name: pulumi.Output[str]
    """
    Name of the accelerated domain. 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.
    """
    http_header_configs: pulumi.Output[list]
    """
    The http header configs of the accelerated domain.

      * `headerId` (`str`)
      * `headerKey` (`str`) - Header key of the http header. Valid values are `Content-Type`, `Cache-Control`, `Content-Disposition`, `Content-Language`，`Expires`, `Access-Control-Allow-Origin`, `Access-Control-Allow-Methods` and `Access-Control-Max-Age`.
      * `headerValue` (`str`) - Header value of the http header.
    """
    optimize_enable: pulumi.Output[str]
    """
    Page Optimize config of the accelerated domain. Valid values are `on` and `off`. Default value is `off`. It can effectively remove the page redundant content, reduce the file size and improve the speed of distribution when this parameter value is `on`.
    """
    page404_config: pulumi.Output[dict]
    """
    The error page config of the accelerated domain.

      * `customPageUrl` (`str`) - Custom page url of the error page. It must be the full path under the accelerated domain name. It's value must be `http://promotion.alicdn.com/help/oss/error.html` when `page_type` value is `charity` and It can not be set when `page_type` value is `default`.
      * `errorCode` (`str`)
      * `pageType` (`str`) - Page type of the error page. Valid values are `default`, `charity`, `other`. Default value is `default`.
    """
    page_compress_enable: pulumi.Output[str]
    """
    Page Compress config of the accelerated domain. Valid values are `on` and `off`. Default value is `off`.
    """
    parameter_filter_config: pulumi.Output[dict]
    """
    The parameter filter config of the accelerated domain.

      * `enable` (`str`) - This parameter indicates whether or not the `parameter_filter_config` is enable. Valid values are `on` and `off`. Default value is `off`.  
      * `hashKeyArgs` (`list`) - Reserved parameters of `parameter_filter_config`. It's a list of string and consists of at most 10 items.
    """
    range_enable: pulumi.Output[str]
    """
    Range Source config of the accelerated domain. Valid values are `on` and `off`. Default value is `off`.
    """
    refer_config: pulumi.Output[dict]
    """
    The refer config of the accelerated domain.

      * `allowEmpty` (`str`) - This parameter indicates whether or not to allow empty refer access. Valid values are `on` and `off`. Default value is `on`.
      * `referLists` (`list`) - A list of domain names of the refer config.
      * `referType` (`str`) - Refer type of the refer config. Valid values are `block` and `allow`. Default value is `block`.
    """
    scope: pulumi.Output[str]
    """
    Scope of the accelerated domain. Valid values are `domestic`, `overseas`, `global`. Default value is `domestic`. This parameter's setting is valid Only for the international users and domestic L3 and above users .
    """
    source_port: pulumi.Output[float]
    """
    Source port of the accelerated domain. Valid values are `80` and `443`. Default value is `80`. You must use `80` when the `source_type` is `oss`.
    """
    source_type: pulumi.Output[str]
    """
    Source type of the accelerated domain. Valid values are `ipaddr`, `domain`, `oss`. You must set this parameter when `cdn_type` value is not `liveStream`.
    """
    sources: pulumi.Output[list]
    """
    Sources of the accelerated domain. It's a list of domain names or IP address and consists of at most 20 items. You must set this parameter when `cdn_type` value is not `liveStream`.
    """
    video_seek_enable: pulumi.Output[str]
    """
    Video Seek config of the accelerated domain. Valid values are `on` and `off`. Default value is `off`.
    """
    def __init__(__self__, resource_name, opts=None, auth_config=None, block_ips=None, cache_configs=None, cdn_type=None, certificate_config=None, domain_name=None, http_header_configs=None, optimize_enable=None, page404_config=None, page_compress_enable=None, parameter_filter_config=None, range_enable=None, refer_config=None, scope=None, source_port=None, source_type=None, sources=None, video_seek_enable=None, __props__=None, __name__=None, __opts__=None):
        """
        Create a Domain resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[dict] auth_config: The auth config of the accelerated domain.
        :param pulumi.Input[list] cache_configs: The cache configs of the accelerated domain.
        :param pulumi.Input[str] cdn_type: Cdn type of the accelerated domain. Valid values are `web`, `download`, `video`, `liveStream`.
        :param pulumi.Input[str] domain_name: Name of the accelerated domain. 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.
        :param pulumi.Input[list] http_header_configs: The http header configs of the accelerated domain.
        :param pulumi.Input[str] optimize_enable: Page Optimize config of the accelerated domain. Valid values are `on` and `off`. Default value is `off`. It can effectively remove the page redundant content, reduce the file size and improve the speed of distribution when this parameter value is `on`.
        :param pulumi.Input[dict] page404_config: The error page config of the accelerated domain.
        :param pulumi.Input[str] page_compress_enable: Page Compress config of the accelerated domain. Valid values are `on` and `off`. Default value is `off`.
        :param pulumi.Input[dict] parameter_filter_config: The parameter filter config of the accelerated domain.
        :param pulumi.Input[str] range_enable: Range Source config of the accelerated domain. Valid values are `on` and `off`. Default value is `off`.
        :param pulumi.Input[dict] refer_config: The refer config of the accelerated domain.
        :param pulumi.Input[str] scope: Scope of the accelerated domain. Valid values are `domestic`, `overseas`, `global`. Default value is `domestic`. This parameter's setting is valid Only for the international users and domestic L3 and above users .
        :param pulumi.Input[float] source_port: Source port of the accelerated domain. Valid values are `80` and `443`. Default value is `80`. You must use `80` when the `source_type` is `oss`.
        :param pulumi.Input[str] source_type: Source type of the accelerated domain. Valid values are `ipaddr`, `domain`, `oss`. You must set this parameter when `cdn_type` value is not `liveStream`.
        :param pulumi.Input[list] sources: Sources of the accelerated domain. It's a list of domain names or IP address and consists of at most 20 items. You must set this parameter when `cdn_type` value is not `liveStream`.
        :param pulumi.Input[str] video_seek_enable: Video Seek config of the accelerated domain. Valid values are `on` and `off`. Default value is `off`.

        The **auth_config** object supports the following:

          * `auth_type` (`pulumi.Input[str]`) - Auth type of the auth config. Valid values are  `no_auth`, `type_a`, `type_b` and `type_c`. Default value is `no_auth`.
          * `masterKey` (`pulumi.Input[str]`) - Master authentication key of the auth config. This parameter can have a string of 6 to 32 characters and must contain only alphanumeric characters.
          * `slaveKey` (`pulumi.Input[str]`) - Slave authentication key of the auth config. This parameter can have a string of 6 to 32 characters and must contain only alphanumeric characters.
          * `timeout` (`pulumi.Input[float]`) - Authentication cache time of the auth config. Default value is `1800`. It's value is valid only when the `auth_type` is `type_b` or `type_c`.

        The **cache_configs** object supports the following:

          * `cacheContent` (`pulumi.Input[str]`) - Cache content of the cache config. It's value is a path string when the `cache_type` is `path`. When the `cache_type` is `suffix`, it's value is a string which contains multiple file suffixes separated by commas.
          * `cacheId` (`pulumi.Input[str]`)
          * `cacheType` (`pulumi.Input[str]`) - Cache type of the cache config. Valid values are `suffix` and `path`.
          * `ttl` (`pulumi.Input[float]`) - Cache time of the cache config.
          * `weight` (`pulumi.Input[float]`) - Weight of the cache config. This parameter's value is between 1 and 99. Default value is `1`. The higher the value, the higher the priority.

        The **certificate_config** object supports the following:

          * `private_key` (`pulumi.Input[str]`) - The SSL private key. This is required if `server_certificate_status` is `on`
          * `server_certificate` (`pulumi.Input[str]`) - The SSL server certificate string. This is required if `server_certificate_status` is `on`
          * `serverCertificateStatus` (`pulumi.Input[str]`) - This parameter indicates whether or not enable https. Valid values are `on` and `off`. Default value is `on`.

        The **http_header_configs** object supports the following:

          * `headerId` (`pulumi.Input[str]`)
          * `headerKey` (`pulumi.Input[str]`) - Header key of the http header. Valid values are `Content-Type`, `Cache-Control`, `Content-Disposition`, `Content-Language`，`Expires`, `Access-Control-Allow-Origin`, `Access-Control-Allow-Methods` and `Access-Control-Max-Age`.
          * `headerValue` (`pulumi.Input[str]`) - Header value of the http header.

        The **page404_config** object supports the following:

          * `customPageUrl` (`pulumi.Input[str]`) - Custom page url of the error page. It must be the full path under the accelerated domain name. It's value must be `http://promotion.alicdn.com/help/oss/error.html` when `page_type` value is `charity` and It can not be set when `page_type` value is `default`.
          * `errorCode` (`pulumi.Input[str]`)
          * `pageType` (`pulumi.Input[str]`) - Page type of the error page. Valid values are `default`, `charity`, `other`. Default value is `default`.

        The **parameter_filter_config** object supports the following:

          * `enable` (`pulumi.Input[str]`) - This parameter indicates whether or not the `parameter_filter_config` is enable. Valid values are `on` and `off`. Default value is `off`.  
          * `hashKeyArgs` (`pulumi.Input[list]`) - Reserved parameters of `parameter_filter_config`. It's a list of string and consists of at most 10 items.

        The **refer_config** object supports the following:

          * `allowEmpty` (`pulumi.Input[str]`) - This parameter indicates whether or not to allow empty refer access. Valid values are `on` and `off`. Default value is `on`.
          * `referLists` (`pulumi.Input[list]`) - A list of domain names of the refer config.
          * `referType` (`pulumi.Input[str]`) - Refer type of the refer config. Valid values are `block` and `allow`. Default value is `block`.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = utilities.get_version()
        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__ = dict()

            __props__['auth_config'] = auth_config
            __props__['block_ips'] = block_ips
            __props__['cache_configs'] = cache_configs
            if cdn_type is None:
                raise TypeError("Missing required property 'cdn_type'")
            __props__['cdn_type'] = cdn_type
            __props__['certificate_config'] = certificate_config
            if domain_name is None:
                raise TypeError("Missing required property 'domain_name'")
            __props__['domain_name'] = domain_name
            __props__['http_header_configs'] = http_header_configs
            __props__['optimize_enable'] = optimize_enable
            __props__['page404_config'] = page404_config
            __props__['page_compress_enable'] = page_compress_enable
            __props__['parameter_filter_config'] = parameter_filter_config
            __props__['range_enable'] = range_enable
            __props__['refer_config'] = refer_config
            __props__['scope'] = scope
            __props__['source_port'] = source_port
            __props__['source_type'] = source_type
            __props__['sources'] = sources
            __props__['video_seek_enable'] = video_seek_enable
        super(Domain, __self__).__init__(
            'alicloud:cdn/domain:Domain',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, auth_config=None, block_ips=None, cache_configs=None, cdn_type=None, certificate_config=None, domain_name=None, http_header_configs=None, optimize_enable=None, page404_config=None, page_compress_enable=None, parameter_filter_config=None, range_enable=None, refer_config=None, scope=None, source_port=None, source_type=None, sources=None, video_seek_enable=None):
        """
        Get an existing Domain 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 str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[dict] auth_config: The auth config of the accelerated domain.
        :param pulumi.Input[list] cache_configs: The cache configs of the accelerated domain.
        :param pulumi.Input[str] cdn_type: Cdn type of the accelerated domain. Valid values are `web`, `download`, `video`, `liveStream`.
        :param pulumi.Input[str] domain_name: Name of the accelerated domain. 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.
        :param pulumi.Input[list] http_header_configs: The http header configs of the accelerated domain.
        :param pulumi.Input[str] optimize_enable: Page Optimize config of the accelerated domain. Valid values are `on` and `off`. Default value is `off`. It can effectively remove the page redundant content, reduce the file size and improve the speed of distribution when this parameter value is `on`.
        :param pulumi.Input[dict] page404_config: The error page config of the accelerated domain.
        :param pulumi.Input[str] page_compress_enable: Page Compress config of the accelerated domain. Valid values are `on` and `off`. Default value is `off`.
        :param pulumi.Input[dict] parameter_filter_config: The parameter filter config of the accelerated domain.
        :param pulumi.Input[str] range_enable: Range Source config of the accelerated domain. Valid values are `on` and `off`. Default value is `off`.
        :param pulumi.Input[dict] refer_config: The refer config of the accelerated domain.
        :param pulumi.Input[str] scope: Scope of the accelerated domain. Valid values are `domestic`, `overseas`, `global`. Default value is `domestic`. This parameter's setting is valid Only for the international users and domestic L3 and above users .
        :param pulumi.Input[float] source_port: Source port of the accelerated domain. Valid values are `80` and `443`. Default value is `80`. You must use `80` when the `source_type` is `oss`.
        :param pulumi.Input[str] source_type: Source type of the accelerated domain. Valid values are `ipaddr`, `domain`, `oss`. You must set this parameter when `cdn_type` value is not `liveStream`.
        :param pulumi.Input[list] sources: Sources of the accelerated domain. It's a list of domain names or IP address and consists of at most 20 items. You must set this parameter when `cdn_type` value is not `liveStream`.
        :param pulumi.Input[str] video_seek_enable: Video Seek config of the accelerated domain. Valid values are `on` and `off`. Default value is `off`.

        The **auth_config** object supports the following:

          * `auth_type` (`pulumi.Input[str]`) - Auth type of the auth config. Valid values are  `no_auth`, `type_a`, `type_b` and `type_c`. Default value is `no_auth`.
          * `masterKey` (`pulumi.Input[str]`) - Master authentication key of the auth config. This parameter can have a string of 6 to 32 characters and must contain only alphanumeric characters.
          * `slaveKey` (`pulumi.Input[str]`) - Slave authentication key of the auth config. This parameter can have a string of 6 to 32 characters and must contain only alphanumeric characters.
          * `timeout` (`pulumi.Input[float]`) - Authentication cache time of the auth config. Default value is `1800`. It's value is valid only when the `auth_type` is `type_b` or `type_c`.

        The **cache_configs** object supports the following:

          * `cacheContent` (`pulumi.Input[str]`) - Cache content of the cache config. It's value is a path string when the `cache_type` is `path`. When the `cache_type` is `suffix`, it's value is a string which contains multiple file suffixes separated by commas.
          * `cacheId` (`pulumi.Input[str]`)
          * `cacheType` (`pulumi.Input[str]`) - Cache type of the cache config. Valid values are `suffix` and `path`.
          * `ttl` (`pulumi.Input[float]`) - Cache time of the cache config.
          * `weight` (`pulumi.Input[float]`) - Weight of the cache config. This parameter's value is between 1 and 99. Default value is `1`. The higher the value, the higher the priority.

        The **certificate_config** object supports the following:

          * `private_key` (`pulumi.Input[str]`) - The SSL private key. This is required if `server_certificate_status` is `on`
          * `server_certificate` (`pulumi.Input[str]`) - The SSL server certificate string. This is required if `server_certificate_status` is `on`
          * `serverCertificateStatus` (`pulumi.Input[str]`) - This parameter indicates whether or not enable https. Valid values are `on` and `off`. Default value is `on`.

        The **http_header_configs** object supports the following:

          * `headerId` (`pulumi.Input[str]`)
          * `headerKey` (`pulumi.Input[str]`) - Header key of the http header. Valid values are `Content-Type`, `Cache-Control`, `Content-Disposition`, `Content-Language`，`Expires`, `Access-Control-Allow-Origin`, `Access-Control-Allow-Methods` and `Access-Control-Max-Age`.
          * `headerValue` (`pulumi.Input[str]`) - Header value of the http header.

        The **page404_config** object supports the following:

          * `customPageUrl` (`pulumi.Input[str]`) - Custom page url of the error page. It must be the full path under the accelerated domain name. It's value must be `http://promotion.alicdn.com/help/oss/error.html` when `page_type` value is `charity` and It can not be set when `page_type` value is `default`.
          * `errorCode` (`pulumi.Input[str]`)
          * `pageType` (`pulumi.Input[str]`) - Page type of the error page. Valid values are `default`, `charity`, `other`. Default value is `default`.

        The **parameter_filter_config** object supports the following:

          * `enable` (`pulumi.Input[str]`) - This parameter indicates whether or not the `parameter_filter_config` is enable. Valid values are `on` and `off`. Default value is `off`.  
          * `hashKeyArgs` (`pulumi.Input[list]`) - Reserved parameters of `parameter_filter_config`. It's a list of string and consists of at most 10 items.

        The **refer_config** object supports the following:

          * `allowEmpty` (`pulumi.Input[str]`) - This parameter indicates whether or not to allow empty refer access. Valid values are `on` and `off`. Default value is `on`.
          * `referLists` (`pulumi.Input[list]`) - A list of domain names of the refer config.
          * `referType` (`pulumi.Input[str]`) - Refer type of the refer config. Valid values are `block` and `allow`. Default value is `block`.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["auth_config"] = auth_config
        __props__["block_ips"] = block_ips
        __props__["cache_configs"] = cache_configs
        __props__["cdn_type"] = cdn_type
        __props__["certificate_config"] = certificate_config
        __props__["domain_name"] = domain_name
        __props__["http_header_configs"] = http_header_configs
        __props__["optimize_enable"] = optimize_enable
        __props__["page404_config"] = page404_config
        __props__["page_compress_enable"] = page_compress_enable
        __props__["parameter_filter_config"] = parameter_filter_config
        __props__["range_enable"] = range_enable
        __props__["refer_config"] = refer_config
        __props__["scope"] = scope
        __props__["source_port"] = source_port
        __props__["source_type"] = source_type
        __props__["sources"] = sources
        __props__["video_seek_enable"] = video_seek_enable
        return Domain(resource_name, opts=opts, __props__=__props__)
    def translate_output_property(self, prop):
        return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

