![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azure.appservice.kotlin.CustomHostnameBindingArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.appservice.kotlin
import com.pulumi.azure.appservice.CustomHostnameBindingArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Manages a Hostname Binding within an App Service (or Function App).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* import * as random from "@pulumi/random";
* const server = new random.RandomId("server", {
* keepers: {
* azi_id: "1",
* },
* byteLength: 8,
* });
* const example = new azure.core.ResourceGroup("example", {
* name: "some-resource-group",
* location: "West Europe",
* });
* const examplePlan = new azure.appservice.Plan("example", {
* name: "some-app-service-plan",
* location: example.location,
* resourceGroupName: example.name,
* sku: {
* tier: "Standard",
* size: "S1",
* },
* });
* const exampleAppService = new azure.appservice.AppService("example", {
* name: server.hex,
* location: example.location,
* resourceGroupName: example.name,
* appServicePlanId: examplePlan.id,
* });
* const exampleCustomHostnameBinding = new azure.appservice.CustomHostnameBinding("example", {
* hostname: "www.mywebsite.com",
* appServiceName: exampleAppService.name,
* resourceGroupName: example.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* import pulumi_random as random
* server = random.RandomId("server",
* keepers={
* "azi_id": "1",
* },
* byte_length=8)
* 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=server.hex,
* location=example.location,
* resource_group_name=example.name,
* app_service_plan_id=example_plan.id)
* example_custom_hostname_binding = azure.appservice.CustomHostnameBinding("example",
* hostname="www.mywebsite.com",
* app_service_name=example_app_service.name,
* resource_group_name=example.name)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* using Random = Pulumi.Random;
* return await Deployment.RunAsync(() =>
* {
* var server = new Random.RandomId("server", new()
* {
* Keepers =
* {
* { "azi_id", "1" },
* },
* ByteLength = 8,
* });
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "some-resource-group",
* Location = "West Europe",
* });
* var examplePlan = new Azure.AppService.Plan("example", new()
* {
* Name = "some-app-service-plan",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Sku = new Azure.AppService.Inputs.PlanSkuArgs
* {
* Tier = "Standard",
* Size = "S1",
* },
* });
* var exampleAppService = new Azure.AppService.AppService("example", new()
* {
* Name = server.Hex,
* Location = example.Location,
* ResourceGroupName = example.Name,
* AppServicePlanId = examplePlan.Id,
* });
* var exampleCustomHostnameBinding = new Azure.AppService.CustomHostnameBinding("example", new()
* {
* Hostname = "www.mywebsite.com",
* AppServiceName = exampleAppService.Name,
* ResourceGroupName = example.Name,
* });
* });
* ```
* ```go
* 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-random/sdk/v4/go/random"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* server, err := random.NewRandomId(ctx, "server", &random.RandomIdArgs{
* Keepers: pulumi.StringMap{
* "azi_id": pulumi.String("1"),
* },
* ByteLength: pulumi.Int(8),
* })
* if err != nil {
* return err
* }
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("some-resource-group"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* examplePlan, err := appservice.NewPlan(ctx, "example", &appservice.PlanArgs{
* Name: pulumi.String("some-app-service-plan"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Sku: &appservice.PlanSkuArgs{
* Tier: pulumi.String("Standard"),
* Size: pulumi.String("S1"),
* },
* })
* if err != nil {
* return err
* }
* exampleAppService, err := appservice.NewAppService(ctx, "example", &appservice.AppServiceArgs{
* Name: server.Hex,
* Location: example.Location,
* ResourceGroupName: example.Name,
* AppServicePlanId: examplePlan.ID(),
* })
* if err != nil {
* return err
* }
* _, err = appservice.NewCustomHostnameBinding(ctx, "example", &appservice.CustomHostnameBindingArgs{
* Hostname: pulumi.String("www.mywebsite.com"),
* AppServiceName: exampleAppService.Name,
* ResourceGroupName: example.Name,
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.random.RandomId;
* import com.pulumi.random.RandomIdArgs;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.appservice.Plan;
* import com.pulumi.azure.appservice.PlanArgs;
* import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
* import com.pulumi.azure.appservice.AppService;
* import com.pulumi.azure.appservice.AppServiceArgs;
* import com.pulumi.azure.appservice.CustomHostnameBinding;
* import com.pulumi.azure.appservice.CustomHostnameBindingArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var server = new RandomId("server", RandomIdArgs.builder()
* .keepers(Map.of("azi_id", 1))
* .byteLength(8)
* .build());
* var example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("some-resource-group")
* .location("West Europe")
* .build());
* var examplePlan = new Plan("examplePlan", PlanArgs.builder()
* .name("some-app-service-plan")
* .location(example.location())
* .resourceGroupName(example.name())
* .sku(PlanSkuArgs.builder()
* .tier("Standard")
* .size("S1")
* .build())
* .build());
* var exampleAppService = new AppService("exampleAppService", AppServiceArgs.builder()
* .name(server.hex())
* .location(example.location())
* .resourceGroupName(example.name())
* .appServicePlanId(examplePlan.id())
* .build());
* var exampleCustomHostnameBinding = new CustomHostnameBinding("exampleCustomHostnameBinding", CustomHostnameBindingArgs.builder()
* .hostname("www.mywebsite.com")
* .appServiceName(exampleAppService.name())
* .resourceGroupName(example.name())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* server:
* type: random:RandomId
* properties:
* keepers:
* azi_id: 1
* byteLength: 8
* example:
* type: azure:core:ResourceGroup
* properties:
* name: some-resource-group
* location: West Europe
* examplePlan:
* type: azure:appservice:Plan
* name: example
* properties:
* name: some-app-service-plan
* location: ${example.location}
* resourceGroupName: ${example.name}
* sku:
* tier: Standard
* size: S1
* exampleAppService:
* type: azure:appservice:AppService
* name: example
* properties:
* name: ${server.hex}
* location: ${example.location}
* resourceGroupName: ${example.name}
* appServicePlanId: ${examplePlan.id}
* exampleCustomHostnameBinding:
* type: azure:appservice:CustomHostnameBinding
* name: example
* properties:
* hostname: www.mywebsite.com
* appServiceName: ${exampleAppService.name}
* resourceGroupName: ${example.name}
* ```
*
* ## Import
* App Service Custom Hostname Bindings can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:appservice/customHostnameBinding:CustomHostnameBinding mywebsite /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/instance1/hostNameBindings/mywebsite.com
* ```
* @property appServiceName The name of the App Service in which to add the Custom Hostname Binding. Changing this forces a new resource to be created.
* @property 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.
* @property resourceGroupName The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
* @property sslState The SSL type. Possible values are `IpBasedEnabled` and `SniEnabled`. Changing this forces a new resource to be created.
* @property thumbprint The SSL certificate thumbprint. Changing this forces a new resource to be created.
* > **NOTE:** `thumbprint` must be specified when `ssl_state` is set.
*/
public data class CustomHostnameBindingArgs(
public val appServiceName: Output? = null,
public val hostname: Output? = null,
public val resourceGroupName: Output? = null,
public val sslState: Output? = null,
public val thumbprint: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.appservice.CustomHostnameBindingArgs =
com.pulumi.azure.appservice.CustomHostnameBindingArgs.builder()
.appServiceName(appServiceName?.applyValue({ args0 -> args0 }))
.hostname(hostname?.applyValue({ args0 -> args0 }))
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.sslState(sslState?.applyValue({ args0 -> args0 }))
.thumbprint(thumbprint?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [CustomHostnameBindingArgs].
*/
@PulumiTagMarker
public class CustomHostnameBindingArgsBuilder internal constructor() {
private var appServiceName: Output? = null
private var hostname: Output? = null
private var resourceGroupName: Output? = null
private var sslState: Output? = null
private var thumbprint: Output? = null
/**
* @param value The name of the App Service in which to add the Custom Hostname Binding. Changing this forces a new resource to be created.
*/
@JvmName("rllgqkvvhscjcqrf")
public suspend fun appServiceName(`value`: Output) {
this.appServiceName = value
}
/**
* @param value 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.
*/
@JvmName("aegjcqamtfbsdkjm")
public suspend fun hostname(`value`: Output) {
this.hostname = value
}
/**
* @param value The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
*/
@JvmName("oexbbauyyfwpiosn")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value The SSL type. Possible values are `IpBasedEnabled` and `SniEnabled`. Changing this forces a new resource to be created.
*/
@JvmName("smwbimbknisstnot")
public suspend fun sslState(`value`: Output) {
this.sslState = value
}
/**
* @param value The SSL certificate thumbprint. Changing this forces a new resource to be created.
* > **NOTE:** `thumbprint` must be specified when `ssl_state` is set.
*/
@JvmName("yodgjcjbxqelhsmf")
public suspend fun thumbprint(`value`: Output) {
this.thumbprint = value
}
/**
* @param value The name of the App Service in which to add the Custom Hostname Binding. Changing this forces a new resource to be created.
*/
@JvmName("tinjwwjyyxbvwwgh")
public suspend fun appServiceName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.appServiceName = mapped
}
/**
* @param value 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.
*/
@JvmName("gafnavtvshyuihde")
public suspend fun hostname(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.hostname = mapped
}
/**
* @param value The name of the resource group in which the App Service exists. Changing this forces a new resource to be created.
*/
@JvmName("aomplpinaetrdlik")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
/**
* @param value The SSL type. Possible values are `IpBasedEnabled` and `SniEnabled`. Changing this forces a new resource to be created.
*/
@JvmName("ajexvyrhqlohdwux")
public suspend fun sslState(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sslState = mapped
}
/**
* @param value The SSL certificate thumbprint. Changing this forces a new resource to be created.
* > **NOTE:** `thumbprint` must be specified when `ssl_state` is set.
*/
@JvmName("ivjwitlvnolhuols")
public suspend fun thumbprint(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.thumbprint = mapped
}
internal fun build(): CustomHostnameBindingArgs = CustomHostnameBindingArgs(
appServiceName = appServiceName,
hostname = hostname,
resourceGroupName = resourceGroupName,
sslState = sslState,
thumbprint = thumbprint,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy