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


class CustomHttpsConfiguration(pulumi.CustomResource):
    custom_https_configuration: pulumi.Output[dict]
    custom_https_provisioning_enabled: pulumi.Output[bool]
    """
    Should the HTTPS protocol be enabled for this custom domain associated with the Front Door?
    """
    frontend_endpoint_id: pulumi.Output[str]
    """
    Id of the Front Door Frontend endpoint this configuration refers to.
    """
    resource_group_name: pulumi.Output[str]
    """
    Specifies the name of the Resource Group in which the Front Door exists
    """
    def __init__(__self__, resource_name, opts=None, custom_https_configuration=None, custom_https_provisioning_enabled=None, frontend_endpoint_id=None, resource_group_name=None, __props__=None, __name__=None, __opts__=None):
        """
        Manages the Custom Https Configuration for an Azure Front Door Frontend Endpoint..

        > **NOTE:** Custom https configurations for a Front Door Frontened Endpoint can be defined both within the `frontdoor.Frontdoor` resource via the `custom_https_configuration` block and by using a separate resource, as described in the following sections.

        > **NOTE:** Defining custom https configurations using a separate `frontdoor.CustomHttpsConfiguration` resource allows for parallel creation/update.

        ```python
        import pulumi
        import pulumi_azure as azure

        example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="EastUS2")
        vault = azure.keyvault.get_key_vault(name="example-vault",
            resource_group_name="example-vault-rg")
        example_frontdoor = azure.frontdoor.Frontdoor("exampleFrontdoor",
            resource_group_name=example_resource_group.name,
            enforce_backend_pools_certificate_name_check=False,
            routing_rules=[{
                "name": "exampleRoutingRule1",
                "acceptedProtocols": [
                    "Http",
                    "Https",
                ],
                "patternsToMatches": ["/*"],
                "frontend_endpoints": ["exampleFrontendEndpoint1"],
                "forwardingConfiguration": {
                    "forwardingProtocol": "MatchRequest",
                    "backendPoolName": "exampleBackendBing",
                },
            }],
            backend_pool_load_balancings=[{
                "name": "exampleLoadBalancingSettings1",
            }],
            backend_pool_health_probes=[{
                "name": "exampleHealthProbeSetting1",
            }],
            backend_pools=[{
                "name": "exampleBackendBing",
                "backends": [{
                    "hostHeader": "www.bing.com",
                    "address": "www.bing.com",
                    "httpPort": 80,
                    "httpsPort": 443,
                }],
                "loadBalancingName": "exampleLoadBalancingSettings1",
                "healthProbeName": "exampleHealthProbeSetting1",
            }],
            frontend_endpoints=[
                {
                    "name": "exampleFrontendEndpoint1",
                    "host_name": "example-FrontDoor.azurefd.net",
                },
                {
                    "name": "exampleFrontendEndpoint2",
                    "host_name": "examplefd1.examplefd.net",
                },
            ])
        example_custom_https0 = azure.frontdoor.CustomHttpsConfiguration("exampleCustomHttps0",
            frontend_endpoint_id=example_frontdoor.frontend_endpoints[0]["id"],
            resource_group_name=example_resource_group.name,
            custom_https_provisioning_enabled=False)
        example_custom_https1 = azure.frontdoor.CustomHttpsConfiguration("exampleCustomHttps1",
            frontend_endpoint_id=example_frontdoor.frontend_endpoints[1]["id"],
            resource_group_name=example_resource_group.name,
            custom_https_provisioning_enabled=True,
            custom_https_configuration={
                "certificateSource": "AzureKeyVault",
                "azureKeyVaultCertificateSecretName": "examplefd1",
                "azureKeyVaultCertificateSecretVersion": "ec8d0737e0df4f4gb52ecea858e97a73",
                "azureKeyVaultCertificateVaultId": vault.id,
            })
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[bool] custom_https_provisioning_enabled: Should the HTTPS protocol be enabled for this custom domain associated with the Front Door?
        :param pulumi.Input[str] frontend_endpoint_id: Id of the Front Door Frontend endpoint this configuration refers to.
        :param pulumi.Input[str] resource_group_name: Specifies the name of the Resource Group in which the Front Door exists

        The **custom_https_configuration** object supports the following:

          * `azureKeyVaultCertificateSecretName` (`pulumi.Input[str]`) - The name of the Key Vault secret representing the full certificate PFX.
          * `azureKeyVaultCertificateSecretVersion` (`pulumi.Input[str]`) - The version of the Key Vault secret representing the full certificate PFX.
          * `azureKeyVaultCertificateVaultId` (`pulumi.Input[str]`) - The ID of the Key Vault containing the SSL certificate.
          * `certificateSource` (`pulumi.Input[str]`) - Certificate source to encrypted `HTTPS` traffic with. Allowed values are `FrontDoor` or `AzureKeyVault`. Defaults to `FrontDoor`.
          * `minimum_tls_version` (`pulumi.Input[str]`) - Minimum client TLS version supported.
          * `provisioningState` (`pulumi.Input[str]`)
          * `provisioningSubstate` (`pulumi.Input[str]`)
        """
        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__['custom_https_configuration'] = custom_https_configuration
            if custom_https_provisioning_enabled is None:
                raise TypeError("Missing required property 'custom_https_provisioning_enabled'")
            __props__['custom_https_provisioning_enabled'] = custom_https_provisioning_enabled
            if frontend_endpoint_id is None:
                raise TypeError("Missing required property 'frontend_endpoint_id'")
            __props__['frontend_endpoint_id'] = frontend_endpoint_id
            if resource_group_name is None:
                raise TypeError("Missing required property 'resource_group_name'")
            __props__['resource_group_name'] = resource_group_name
        super(CustomHttpsConfiguration, __self__).__init__(
            'azure:frontdoor/customHttpsConfiguration:CustomHttpsConfiguration',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, custom_https_configuration=None, custom_https_provisioning_enabled=None, frontend_endpoint_id=None, resource_group_name=None):
        """
        Get an existing CustomHttpsConfiguration 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[bool] custom_https_provisioning_enabled: Should the HTTPS protocol be enabled for this custom domain associated with the Front Door?
        :param pulumi.Input[str] frontend_endpoint_id: Id of the Front Door Frontend endpoint this configuration refers to.
        :param pulumi.Input[str] resource_group_name: Specifies the name of the Resource Group in which the Front Door exists

        The **custom_https_configuration** object supports the following:

          * `azureKeyVaultCertificateSecretName` (`pulumi.Input[str]`) - The name of the Key Vault secret representing the full certificate PFX.
          * `azureKeyVaultCertificateSecretVersion` (`pulumi.Input[str]`) - The version of the Key Vault secret representing the full certificate PFX.
          * `azureKeyVaultCertificateVaultId` (`pulumi.Input[str]`) - The ID of the Key Vault containing the SSL certificate.
          * `certificateSource` (`pulumi.Input[str]`) - Certificate source to encrypted `HTTPS` traffic with. Allowed values are `FrontDoor` or `AzureKeyVault`. Defaults to `FrontDoor`.
          * `minimum_tls_version` (`pulumi.Input[str]`) - Minimum client TLS version supported.
          * `provisioningState` (`pulumi.Input[str]`)
          * `provisioningSubstate` (`pulumi.Input[str]`)
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["custom_https_configuration"] = custom_https_configuration
        __props__["custom_https_provisioning_enabled"] = custom_https_provisioning_enabled
        __props__["frontend_endpoint_id"] = frontend_endpoint_id
        __props__["resource_group_name"] = resource_group_name
        return CustomHttpsConfiguration(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
