# 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 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__ = ['SlotCustomHostnameBindingArgs', 'SlotCustomHostnameBinding']

@pulumi.input_type
class SlotCustomHostnameBindingArgs:
    def __init__(__self__, *,
                 app_service_slot_id: pulumi.Input[str],
                 hostname: pulumi.Input[str],
                 ssl_state: Optional[pulumi.Input[str]] = None,
                 thumbprint: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a SlotCustomHostnameBinding resource.
        :param pulumi.Input[str] app_service_slot_id: The ID of the App Service Slot. Changing this forces a new resource to be created.
        :param pulumi.Input[str] hostname: Specifies the Custom Hostname to use for the App Service, example `www.example.com`. Changing this forces a new resource to be created.
               
               > **NOTE:** A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding.
        :param pulumi.Input[str] ssl_state: The SSL type. Possible values are `IpBasedEnabled` and `SniEnabled`. Changing this forces a new resource to be created.
        :param pulumi.Input[str] thumbprint: The SSL certificate thumbprint. Changing this forces a new resource to be created.
               
               > **NOTE:** `thumbprint` must be specified when `ssl_state` is set.
        """
        pulumi.set(__self__, "app_service_slot_id", app_service_slot_id)
        pulumi.set(__self__, "hostname", hostname)
        if ssl_state is not None:
            pulumi.set(__self__, "ssl_state", ssl_state)
        if thumbprint is not None:
            pulumi.set(__self__, "thumbprint", thumbprint)

    @property
    @pulumi.getter(name="appServiceSlotId")
    def app_service_slot_id(self) -> pulumi.Input[str]:
        """
        The ID of the App Service Slot. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "app_service_slot_id")

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

    @property
    @pulumi.getter
    def hostname(self) -> pulumi.Input[str]:
        """
        Specifies the Custom Hostname to use for the App Service, example `www.example.com`. Changing this forces a new resource to be created.

        > **NOTE:** A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding.
        """
        return pulumi.get(self, "hostname")

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

    @property
    @pulumi.getter(name="sslState")
    def ssl_state(self) -> Optional[pulumi.Input[str]]:
        """
        The SSL type. Possible values are `IpBasedEnabled` and `SniEnabled`. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "ssl_state")

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

    @property
    @pulumi.getter
    def thumbprint(self) -> Optional[pulumi.Input[str]]:
        """
        The SSL certificate thumbprint. Changing this forces a new resource to be created.

        > **NOTE:** `thumbprint` must be specified when `ssl_state` is set.
        """
        return pulumi.get(self, "thumbprint")

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


@pulumi.input_type
class _SlotCustomHostnameBindingState:
    def __init__(__self__, *,
                 app_service_slot_id: Optional[pulumi.Input[str]] = None,
                 hostname: Optional[pulumi.Input[str]] = None,
                 ssl_state: Optional[pulumi.Input[str]] = None,
                 thumbprint: Optional[pulumi.Input[str]] = None,
                 virtual_ip: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering SlotCustomHostnameBinding resources.
        :param pulumi.Input[str] app_service_slot_id: The ID of the App Service Slot. Changing this forces a new resource to be created.
        :param pulumi.Input[str] hostname: Specifies the Custom Hostname to use for the App Service, example `www.example.com`. Changing this forces a new resource to be created.
               
               > **NOTE:** A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding.
        :param pulumi.Input[str] ssl_state: The SSL type. Possible values are `IpBasedEnabled` and `SniEnabled`. Changing this forces a new resource to be created.
        :param pulumi.Input[str] thumbprint: The SSL certificate thumbprint. Changing this forces a new resource to be created.
               
               > **NOTE:** `thumbprint` must be specified when `ssl_state` is set.
        :param pulumi.Input[str] virtual_ip: The virtual IP address assigned to the hostname if IP based SSL is enabled.
        """
        if app_service_slot_id is not None:
            pulumi.set(__self__, "app_service_slot_id", app_service_slot_id)
        if hostname is not None:
            pulumi.set(__self__, "hostname", hostname)
        if ssl_state is not None:
            pulumi.set(__self__, "ssl_state", ssl_state)
        if thumbprint is not None:
            pulumi.set(__self__, "thumbprint", thumbprint)
        if virtual_ip is not None:
            pulumi.set(__self__, "virtual_ip", virtual_ip)

    @property
    @pulumi.getter(name="appServiceSlotId")
    def app_service_slot_id(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the App Service Slot. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "app_service_slot_id")

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

    @property
    @pulumi.getter
    def hostname(self) -> Optional[pulumi.Input[str]]:
        """
        Specifies the Custom Hostname to use for the App Service, example `www.example.com`. Changing this forces a new resource to be created.

        > **NOTE:** A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding.
        """
        return pulumi.get(self, "hostname")

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

    @property
    @pulumi.getter(name="sslState")
    def ssl_state(self) -> Optional[pulumi.Input[str]]:
        """
        The SSL type. Possible values are `IpBasedEnabled` and `SniEnabled`. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "ssl_state")

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

    @property
    @pulumi.getter
    def thumbprint(self) -> Optional[pulumi.Input[str]]:
        """
        The SSL certificate thumbprint. Changing this forces a new resource to be created.

        > **NOTE:** `thumbprint` must be specified when `ssl_state` is set.
        """
        return pulumi.get(self, "thumbprint")

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

    @property
    @pulumi.getter(name="virtualIp")
    def virtual_ip(self) -> Optional[pulumi.Input[str]]:
        """
        The virtual IP address assigned to the hostname if IP based SSL is enabled.
        """
        return pulumi.get(self, "virtual_ip")

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


class SlotCustomHostnameBinding(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 app_service_slot_id: Optional[pulumi.Input[str]] = None,
                 hostname: Optional[pulumi.Input[str]] = None,
                 ssl_state: Optional[pulumi.Input[str]] = None,
                 thumbprint: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Manages a Hostname Binding within an App Service Slot.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example = azure.core.ResourceGroup("example",
            name="some-resource-group",
            location="West Europe")
        example_plan = azure.appservice.Plan("example",
            name="some-app-service-plan",
            location=example.location,
            resource_group_name=example.name,
            sku={
                "tier": "Standard",
                "size": "S1",
            })
        example_app_service = azure.appservice.AppService("example",
            name="some-app-service",
            location=example.location,
            resource_group_name=example.name,
            app_service_plan_id=example_plan.id)
        example_slot = azure.appservice.Slot("example",
            name="staging",
            location=example.location,
            resource_group_name=example.name,
            app_service_name=example_app_service.name,
            app_service_plan_id=example_plan.id)
        example_slot_custom_hostname_binding = azure.appservice.SlotCustomHostnameBinding("example",
            app_service_slot_id=example_slot.id,
            hostname="www.mywebsite.com")
        ```

        ## Import

        App Service Custom Hostname Bindings can be imported using the `resource id`, e.g.

        ```sh
        $ pulumi import azure:appservice/slotCustomHostnameBinding:SlotCustomHostnameBinding mywebsite /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/instance1/slots/staging/hostNameBindings/mywebsite.com
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] app_service_slot_id: The ID of the App Service Slot. Changing this forces a new resource to be created.
        :param pulumi.Input[str] hostname: Specifies the Custom Hostname to use for the App Service, example `www.example.com`. Changing this forces a new resource to be created.
               
               > **NOTE:** A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding.
        :param pulumi.Input[str] ssl_state: The SSL type. Possible values are `IpBasedEnabled` and `SniEnabled`. Changing this forces a new resource to be created.
        :param pulumi.Input[str] thumbprint: The SSL certificate thumbprint. Changing this forces a new resource to be created.
               
               > **NOTE:** `thumbprint` must be specified when `ssl_state` is set.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: SlotCustomHostnameBindingArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages a Hostname Binding within an App Service Slot.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example = azure.core.ResourceGroup("example",
            name="some-resource-group",
            location="West Europe")
        example_plan = azure.appservice.Plan("example",
            name="some-app-service-plan",
            location=example.location,
            resource_group_name=example.name,
            sku={
                "tier": "Standard",
                "size": "S1",
            })
        example_app_service = azure.appservice.AppService("example",
            name="some-app-service",
            location=example.location,
            resource_group_name=example.name,
            app_service_plan_id=example_plan.id)
        example_slot = azure.appservice.Slot("example",
            name="staging",
            location=example.location,
            resource_group_name=example.name,
            app_service_name=example_app_service.name,
            app_service_plan_id=example_plan.id)
        example_slot_custom_hostname_binding = azure.appservice.SlotCustomHostnameBinding("example",
            app_service_slot_id=example_slot.id,
            hostname="www.mywebsite.com")
        ```

        ## Import

        App Service Custom Hostname Bindings can be imported using the `resource id`, e.g.

        ```sh
        $ pulumi import azure:appservice/slotCustomHostnameBinding:SlotCustomHostnameBinding mywebsite /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/instance1/slots/staging/hostNameBindings/mywebsite.com
        ```

        :param str resource_name: The name of the resource.
        :param SlotCustomHostnameBindingArgs 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(SlotCustomHostnameBindingArgs, 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,
                 app_service_slot_id: Optional[pulumi.Input[str]] = None,
                 hostname: Optional[pulumi.Input[str]] = None,
                 ssl_state: Optional[pulumi.Input[str]] = None,
                 thumbprint: 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__ = SlotCustomHostnameBindingArgs.__new__(SlotCustomHostnameBindingArgs)

            if app_service_slot_id is None and not opts.urn:
                raise TypeError("Missing required property 'app_service_slot_id'")
            __props__.__dict__["app_service_slot_id"] = app_service_slot_id
            if hostname is None and not opts.urn:
                raise TypeError("Missing required property 'hostname'")
            __props__.__dict__["hostname"] = hostname
            __props__.__dict__["ssl_state"] = ssl_state
            __props__.__dict__["thumbprint"] = thumbprint
            __props__.__dict__["virtual_ip"] = None
        super(SlotCustomHostnameBinding, __self__).__init__(
            'azure:appservice/slotCustomHostnameBinding:SlotCustomHostnameBinding',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            app_service_slot_id: Optional[pulumi.Input[str]] = None,
            hostname: Optional[pulumi.Input[str]] = None,
            ssl_state: Optional[pulumi.Input[str]] = None,
            thumbprint: Optional[pulumi.Input[str]] = None,
            virtual_ip: Optional[pulumi.Input[str]] = None) -> 'SlotCustomHostnameBinding':
        """
        Get an existing SlotCustomHostnameBinding 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] app_service_slot_id: The ID of the App Service Slot. Changing this forces a new resource to be created.
        :param pulumi.Input[str] hostname: Specifies the Custom Hostname to use for the App Service, example `www.example.com`. Changing this forces a new resource to be created.
               
               > **NOTE:** A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding.
        :param pulumi.Input[str] ssl_state: The SSL type. Possible values are `IpBasedEnabled` and `SniEnabled`. Changing this forces a new resource to be created.
        :param pulumi.Input[str] thumbprint: The SSL certificate thumbprint. Changing this forces a new resource to be created.
               
               > **NOTE:** `thumbprint` must be specified when `ssl_state` is set.
        :param pulumi.Input[str] virtual_ip: The virtual IP address assigned to the hostname if IP based SSL is enabled.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _SlotCustomHostnameBindingState.__new__(_SlotCustomHostnameBindingState)

        __props__.__dict__["app_service_slot_id"] = app_service_slot_id
        __props__.__dict__["hostname"] = hostname
        __props__.__dict__["ssl_state"] = ssl_state
        __props__.__dict__["thumbprint"] = thumbprint
        __props__.__dict__["virtual_ip"] = virtual_ip
        return SlotCustomHostnameBinding(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="appServiceSlotId")
    def app_service_slot_id(self) -> pulumi.Output[str]:
        """
        The ID of the App Service Slot. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "app_service_slot_id")

    @property
    @pulumi.getter
    def hostname(self) -> pulumi.Output[str]:
        """
        Specifies the Custom Hostname to use for the App Service, example `www.example.com`. Changing this forces a new resource to be created.

        > **NOTE:** A CNAME needs to be configured from this Hostname to the Azure Website - otherwise Azure will reject the Hostname Binding.
        """
        return pulumi.get(self, "hostname")

    @property
    @pulumi.getter(name="sslState")
    def ssl_state(self) -> pulumi.Output[str]:
        """
        The SSL type. Possible values are `IpBasedEnabled` and `SniEnabled`. Changing this forces a new resource to be created.
        """
        return pulumi.get(self, "ssl_state")

    @property
    @pulumi.getter
    def thumbprint(self) -> pulumi.Output[str]:
        """
        The SSL certificate thumbprint. Changing this forces a new resource to be created.

        > **NOTE:** `thumbprint` must be specified when `ssl_state` is set.
        """
        return pulumi.get(self, "thumbprint")

    @property
    @pulumi.getter(name="virtualIp")
    def virtual_ip(self) -> pulumi.Output[str]:
        """
        The virtual IP address assigned to the hostname if IP based SSL is enabled.
        """
        return pulumi.get(self, "virtual_ip")

