Azure Classic

Pulumi Official
Package maintained by Pulumi
v5.11.0 published on Monday, Jun 27, 2022 by Pulumi

SlotCustomHostnameBinding

Manages a Hostname Binding within an App Service Slot.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
        {
            Location = "West Europe",
        });
        var examplePlan = new Azure.AppService.Plan("examplePlan", new Azure.AppService.PlanArgs
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            Sku = new Azure.AppService.Inputs.PlanSkuArgs
            {
                Tier = "Standard",
                Size = "S1",
            },
        });
        var exampleAppService = new Azure.AppService.AppService("exampleAppService", new Azure.AppService.AppServiceArgs
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            AppServicePlanId = examplePlan.Id,
        });
        var exampleSlot = new Azure.AppService.Slot("exampleSlot", new Azure.AppService.SlotArgs
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            AppServiceName = exampleAppService.Name,
            AppServicePlanId = examplePlan.Id,
        });
        var exampleSlotCustomHostnameBinding = new Azure.AppService.SlotCustomHostnameBinding("exampleSlotCustomHostnameBinding", new Azure.AppService.SlotCustomHostnameBindingArgs
        {
            AppServiceSlotId = exampleSlot.Id,
            Hostname = "www.mywebsite.com",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		examplePlan, err := appservice.NewPlan(ctx, "examplePlan", &appservice.PlanArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			Sku: &appservice.PlanSkuArgs{
				Tier: pulumi.String("Standard"),
				Size: pulumi.String("S1"),
			},
		})
		if err != nil {
			return err
		}
		exampleAppService, err := appservice.NewAppService(ctx, "exampleAppService", &appservice.AppServiceArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			AppServicePlanId:  examplePlan.ID(),
		})
		if err != nil {
			return err
		}
		exampleSlot, err := appservice.NewSlot(ctx, "exampleSlot", &appservice.SlotArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			AppServiceName:    exampleAppService.Name,
			AppServicePlanId:  examplePlan.ID(),
		})
		if err != nil {
			return err
		}
		_, err = appservice.NewSlotCustomHostnameBinding(ctx, "exampleSlotCustomHostnameBinding", &appservice.SlotCustomHostnameBindingArgs{
			AppServiceSlotId: exampleSlot.ID(),
			Hostname:         pulumi.String("www.mywebsite.com"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var examplePlan = new Plan("examplePlan", PlanArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .sku(PlanSkuArgs.builder()
                .tier("Standard")
                .size("S1")
                .build())
            .build());

        var exampleAppService = new AppService("exampleAppService", AppServiceArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .appServicePlanId(examplePlan.id())
            .build());

        var exampleSlot = new Slot("exampleSlot", SlotArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .appServiceName(exampleAppService.name())
            .appServicePlanId(examplePlan.id())
            .build());

        var exampleSlotCustomHostnameBinding = new SlotCustomHostnameBinding("exampleSlotCustomHostnameBinding", SlotCustomHostnameBindingArgs.builder()        
            .appServiceSlotId(exampleSlot.id())
            .hostname("www.mywebsite.com")
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_plan = azure.appservice.Plan("examplePlan",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku=azure.appservice.PlanSkuArgs(
        tier="Standard",
        size="S1",
    ))
example_app_service = azure.appservice.AppService("exampleAppService",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    app_service_plan_id=example_plan.id)
example_slot = azure.appservice.Slot("exampleSlot",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    app_service_name=example_app_service.name,
    app_service_plan_id=example_plan.id)
example_slot_custom_hostname_binding = azure.appservice.SlotCustomHostnameBinding("exampleSlotCustomHostnameBinding",
    app_service_slot_id=example_slot.id,
    hostname="www.mywebsite.com")
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const examplePlan = new azure.appservice.Plan("examplePlan", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    sku: {
        tier: "Standard",
        size: "S1",
    },
});
const exampleAppService = new azure.appservice.AppService("exampleAppService", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    appServicePlanId: examplePlan.id,
});
const exampleSlot = new azure.appservice.Slot("exampleSlot", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    appServiceName: exampleAppService.name,
    appServicePlanId: examplePlan.id,
});
const exampleSlotCustomHostnameBinding = new azure.appservice.SlotCustomHostnameBinding("exampleSlotCustomHostnameBinding", {
    appServiceSlotId: exampleSlot.id,
    hostname: "www.mywebsite.com",
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  examplePlan:
    type: azure:appservice:Plan
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      sku:
        tier: Standard
        size: S1
  exampleAppService:
    type: azure:appservice:AppService
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      appServicePlanId: ${examplePlan.id}
  exampleSlot:
    type: azure:appservice:Slot
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      appServiceName: ${exampleAppService.name}
      appServicePlanId: ${examplePlan.id}
  exampleSlotCustomHostnameBinding:
    type: azure:appservice:SlotCustomHostnameBinding
    properties:
      appServiceSlotId: ${exampleSlot.id}
      hostname: www.mywebsite.com

Create a SlotCustomHostnameBinding Resource

new SlotCustomHostnameBinding(name: string, args: SlotCustomHostnameBindingArgs, opts?: CustomResourceOptions);
@overload
def SlotCustomHostnameBinding(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              app_service_slot_id: Optional[str] = None,
                              hostname: Optional[str] = None,
                              ssl_state: Optional[str] = None,
                              thumbprint: Optional[str] = None)
@overload
def SlotCustomHostnameBinding(resource_name: str,
                              args: SlotCustomHostnameBindingArgs,
                              opts: Optional[ResourceOptions] = None)
func NewSlotCustomHostnameBinding(ctx *Context, name string, args SlotCustomHostnameBindingArgs, opts ...ResourceOption) (*SlotCustomHostnameBinding, error)
public SlotCustomHostnameBinding(string name, SlotCustomHostnameBindingArgs args, CustomResourceOptions? opts = null)
public SlotCustomHostnameBinding(String name, SlotCustomHostnameBindingArgs args)
public SlotCustomHostnameBinding(String name, SlotCustomHostnameBindingArgs args, CustomResourceOptions options)
type: azure:appservice:SlotCustomHostnameBinding
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args SlotCustomHostnameBindingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args SlotCustomHostnameBindingArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SlotCustomHostnameBindingArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SlotCustomHostnameBindingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SlotCustomHostnameBindingArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

SlotCustomHostnameBinding Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The SlotCustomHostnameBinding resource accepts the following input properties:

AppServiceSlotId string

The ID of the App Service Slot. Changing this forces a new resource to be created.

Hostname string

Specifies the Custom Hostname to use for the App Service, example www.example.com. Changing this forces a new resource to be created.

SslState string

The SSL type. Possible values are IpBasedEnabled and SniEnabled. Changing this forces a new resource to be created.

Thumbprint string

The SSL certificate thumbprint. Changing this forces a new resource to be created.

AppServiceSlotId string

The ID of the App Service Slot. Changing this forces a new resource to be created.

Hostname string

Specifies the Custom Hostname to use for the App Service, example www.example.com. Changing this forces a new resource to be created.

SslState string

The SSL type. Possible values are IpBasedEnabled and SniEnabled. Changing this forces a new resource to be created.

Thumbprint string

The SSL certificate thumbprint. Changing this forces a new resource to be created.

appServiceSlotId String

The ID of the App Service Slot. Changing this forces a new resource to be created.

hostname String

Specifies the Custom Hostname to use for the App Service, example www.example.com. Changing this forces a new resource to be created.

sslState String

The SSL type. Possible values are IpBasedEnabled and SniEnabled. Changing this forces a new resource to be created.

thumbprint String

The SSL certificate thumbprint. Changing this forces a new resource to be created.

appServiceSlotId string

The ID of the App Service Slot. Changing this forces a new resource to be created.

hostname string

Specifies the Custom Hostname to use for the App Service, example www.example.com. Changing this forces a new resource to be created.

sslState string

The SSL type. Possible values are IpBasedEnabled and SniEnabled. Changing this forces a new resource to be created.

thumbprint string

The SSL certificate thumbprint. Changing this forces a new resource to be created.

app_service_slot_id str

The ID of the App Service Slot. Changing this forces a new resource to be created.

hostname str

Specifies the Custom Hostname to use for the App Service, example www.example.com. Changing this forces a new resource to be created.

ssl_state str

The SSL type. Possible values are IpBasedEnabled and SniEnabled. Changing this forces a new resource to be created.

thumbprint str

The SSL certificate thumbprint. Changing this forces a new resource to be created.

appServiceSlotId String

The ID of the App Service Slot. Changing this forces a new resource to be created.

hostname String

Specifies the Custom Hostname to use for the App Service, example www.example.com. Changing this forces a new resource to be created.

sslState String

The SSL type. Possible values are IpBasedEnabled and SniEnabled. Changing this forces a new resource to be created.

thumbprint String

The SSL certificate thumbprint. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the SlotCustomHostnameBinding resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

VirtualIp string

The virtual IP address assigned to the hostname if IP based SSL is enabled.

Id string

The provider-assigned unique ID for this managed resource.

VirtualIp string

The virtual IP address assigned to the hostname if IP based SSL is enabled.

id String

The provider-assigned unique ID for this managed resource.

virtualIp String

The virtual IP address assigned to the hostname if IP based SSL is enabled.

id string

The provider-assigned unique ID for this managed resource.

virtualIp string

The virtual IP address assigned to the hostname if IP based SSL is enabled.

id str

The provider-assigned unique ID for this managed resource.

virtual_ip str

The virtual IP address assigned to the hostname if IP based SSL is enabled.

id String

The provider-assigned unique ID for this managed resource.

virtualIp String

The virtual IP address assigned to the hostname if IP based SSL is enabled.

Look up an Existing SlotCustomHostnameBinding Resource

Get an existing SlotCustomHostnameBinding resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SlotCustomHostnameBindingState, opts?: CustomResourceOptions): SlotCustomHostnameBinding
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        app_service_slot_id: Optional[str] = None,
        hostname: Optional[str] = None,
        ssl_state: Optional[str] = None,
        thumbprint: Optional[str] = None,
        virtual_ip: Optional[str] = None) -> SlotCustomHostnameBinding
func GetSlotCustomHostnameBinding(ctx *Context, name string, id IDInput, state *SlotCustomHostnameBindingState, opts ...ResourceOption) (*SlotCustomHostnameBinding, error)
public static SlotCustomHostnameBinding Get(string name, Input<string> id, SlotCustomHostnameBindingState? state, CustomResourceOptions? opts = null)
public static SlotCustomHostnameBinding get(String name, Output<String> id, SlotCustomHostnameBindingState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AppServiceSlotId string

The ID of the App Service Slot. Changing this forces a new resource to be created.

Hostname string

Specifies the Custom Hostname to use for the App Service, example www.example.com. Changing this forces a new resource to be created.

SslState string

The SSL type. Possible values are IpBasedEnabled and SniEnabled. Changing this forces a new resource to be created.

Thumbprint string

The SSL certificate thumbprint. Changing this forces a new resource to be created.

VirtualIp string

The virtual IP address assigned to the hostname if IP based SSL is enabled.

AppServiceSlotId string

The ID of the App Service Slot. Changing this forces a new resource to be created.

Hostname string

Specifies the Custom Hostname to use for the App Service, example www.example.com. Changing this forces a new resource to be created.

SslState string

The SSL type. Possible values are IpBasedEnabled and SniEnabled. Changing this forces a new resource to be created.

Thumbprint string

The SSL certificate thumbprint. Changing this forces a new resource to be created.

VirtualIp string

The virtual IP address assigned to the hostname if IP based SSL is enabled.

appServiceSlotId String

The ID of the App Service Slot. Changing this forces a new resource to be created.

hostname String

Specifies the Custom Hostname to use for the App Service, example www.example.com. Changing this forces a new resource to be created.

sslState String

The SSL type. Possible values are IpBasedEnabled and SniEnabled. Changing this forces a new resource to be created.

thumbprint String

The SSL certificate thumbprint. Changing this forces a new resource to be created.

virtualIp String

The virtual IP address assigned to the hostname if IP based SSL is enabled.

appServiceSlotId string

The ID of the App Service Slot. Changing this forces a new resource to be created.

hostname string

Specifies the Custom Hostname to use for the App Service, example www.example.com. Changing this forces a new resource to be created.

sslState string

The SSL type. Possible values are IpBasedEnabled and SniEnabled. Changing this forces a new resource to be created.

thumbprint string

The SSL certificate thumbprint. Changing this forces a new resource to be created.

virtualIp string

The virtual IP address assigned to the hostname if IP based SSL is enabled.

app_service_slot_id str

The ID of the App Service Slot. Changing this forces a new resource to be created.

hostname str

Specifies the Custom Hostname to use for the App Service, example www.example.com. Changing this forces a new resource to be created.

ssl_state str

The SSL type. Possible values are IpBasedEnabled and SniEnabled. Changing this forces a new resource to be created.

thumbprint str

The SSL certificate thumbprint. Changing this forces a new resource to be created.

virtual_ip str

The virtual IP address assigned to the hostname if IP based SSL is enabled.

appServiceSlotId String

The ID of the App Service Slot. Changing this forces a new resource to be created.

hostname String

Specifies the Custom Hostname to use for the App Service, example www.example.com. Changing this forces a new resource to be created.

sslState String

The SSL type. Possible values are IpBasedEnabled and SniEnabled. Changing this forces a new resource to be created.

thumbprint String

The SSL certificate thumbprint. Changing this forces a new resource to be created.

virtualIp String

The virtual IP address assigned to the hostname if IP based SSL is enabled.

Import

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

 $ 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

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.