com.pulumi.azure.appservice.kotlin.StaticSiteCustomDomainArgs.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.StaticSiteCustomDomainArgs.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
/**
* ## Example Usage
* ### CNAME validation
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const exampleStaticSite = new azure.appservice.StaticSite("example", {
* name: "example",
* resourceGroupName: example.name,
* location: example.location,
* });
* const exampleCNameRecord = new azure.dns.CNameRecord("example", {
* name: "my-domain",
* zoneName: "contoso.com",
* resourceGroupName: example.name,
* ttl: 300,
* record: exampleStaticSite.defaultHostName,
* });
* const exampleStaticSiteCustomDomain = new azure.appservice.StaticSiteCustomDomain("example", {
* staticSiteId: exampleStaticSite.id,
* domainName: pulumi.interpolate`${exampleCNameRecord.name}.${exampleCNameRecord.zoneName}`,
* validationType: "cname-delegation",
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_static_site = azure.appservice.StaticSite("example",
* name="example",
* resource_group_name=example.name,
* location=example.location)
* example_c_name_record = azure.dns.CNameRecord("example",
* name="my-domain",
* zone_name="contoso.com",
* resource_group_name=example.name,
* ttl=300,
* record=example_static_site.default_host_name)
* example_static_site_custom_domain = azure.appservice.StaticSiteCustomDomain("example",
* static_site_id=example_static_site.id,
* domain_name=pulumi.Output.all(example_c_name_record.name, example_c_name_record.zone_name).apply(lambda name, zone_name: f"{name}.{zone_name}"),
* validation_type="cname-delegation")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var exampleStaticSite = new Azure.AppService.StaticSite("example", new()
* {
* Name = "example",
* ResourceGroupName = example.Name,
* Location = example.Location,
* });
* var exampleCNameRecord = new Azure.Dns.CNameRecord("example", new()
* {
* Name = "my-domain",
* ZoneName = "contoso.com",
* ResourceGroupName = example.Name,
* Ttl = 300,
* Record = exampleStaticSite.DefaultHostName,
* });
* var exampleStaticSiteCustomDomain = new Azure.AppService.StaticSiteCustomDomain("example", new()
* {
* StaticSiteId = exampleStaticSite.Id,
* DomainName = Output.Tuple(exampleCNameRecord.Name, exampleCNameRecord.ZoneName).Apply(values =>
* {
* var name = values.Item1;
* var zoneName = values.Item2;
* return $"{name}.{zoneName}";
* }),
* ValidationType = "cname-delegation",
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-resources"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleStaticSite, err := appservice.NewStaticSite(ctx, "example", &appservice.StaticSiteArgs{
* Name: pulumi.String("example"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* })
* if err != nil {
* return err
* }
* exampleCNameRecord, err := dns.NewCNameRecord(ctx, "example", &dns.CNameRecordArgs{
* Name: pulumi.String("my-domain"),
* ZoneName: pulumi.String("contoso.com"),
* ResourceGroupName: example.Name,
* Ttl: pulumi.Int(300),
* Record: exampleStaticSite.DefaultHostName,
* })
* if err != nil {
* return err
* }
* _, err = appservice.NewStaticSiteCustomDomain(ctx, "example", &appservice.StaticSiteCustomDomainArgs{
* StaticSiteId: exampleStaticSite.ID(),
* DomainName: pulumi.All(exampleCNameRecord.Name, exampleCNameRecord.ZoneName).ApplyT(func(_args []interface{}) (string, error) {
* name := _args[0].(string)
* zoneName := _args[1].(string)
* return fmt.Sprintf("%v.%v", name, zoneName), nil
* }).(pulumi.StringOutput),
* ValidationType: pulumi.String("cname-delegation"),
* })
* 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.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.appservice.StaticSite;
* import com.pulumi.azure.appservice.StaticSiteArgs;
* import com.pulumi.azure.dns.CNameRecord;
* import com.pulumi.azure.dns.CNameRecordArgs;
* import com.pulumi.azure.appservice.StaticSiteCustomDomain;
* import com.pulumi.azure.appservice.StaticSiteCustomDomainArgs;
* 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
* var exampleStaticSite = new StaticSite("exampleStaticSite", StaticSiteArgs.builder()
* .name("example")
* .resourceGroupName(example.name())
* .location(example.location())
* .build());
* var exampleCNameRecord = new CNameRecord("exampleCNameRecord", CNameRecordArgs.builder()
* .name("my-domain")
* .zoneName("contoso.com")
* .resourceGroupName(example.name())
* .ttl(300)
* .record(exampleStaticSite.defaultHostName())
* .build());
* var exampleStaticSiteCustomDomain = new StaticSiteCustomDomain("exampleStaticSiteCustomDomain", StaticSiteCustomDomainArgs.builder()
* .staticSiteId(exampleStaticSite.id())
* .domainName(Output.tuple(exampleCNameRecord.name(), exampleCNameRecord.zoneName()).applyValue(values -> {
* var name = values.t1;
* var zoneName = values.t2;
* return String.format("%s.%s", name,zoneName);
* }))
* .validationType("cname-delegation")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleStaticSite:
* type: azure:appservice:StaticSite
* name: example
* properties:
* name: example
* resourceGroupName: ${example.name}
* location: ${example.location}
* exampleCNameRecord:
* type: azure:dns:CNameRecord
* name: example
* properties:
* name: my-domain
* zoneName: contoso.com
* resourceGroupName: ${example.name}
* ttl: 300
* record: ${exampleStaticSite.defaultHostName}
* exampleStaticSiteCustomDomain:
* type: azure:appservice:StaticSiteCustomDomain
* name: example
* properties:
* staticSiteId: ${exampleStaticSite.id}
* domainName: ${exampleCNameRecord.name}.${exampleCNameRecord.zoneName}
* validationType: cname-delegation
* ```
*
* ### TXT validation
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const exampleStaticSite = new azure.appservice.StaticSite("example", {
* name: "example",
* resourceGroupName: example.name,
* location: example.location,
* });
* const exampleStaticSiteCustomDomain = new azure.appservice.StaticSiteCustomDomain("example", {
* staticSiteId: exampleStaticSite.id,
* domainName: "my-domain.contoso.com",
* validationType: "dns-txt-token",
* });
* const exampleTxtRecord = new azure.dns.TxtRecord("example", {
* name: "_dnsauth.my-domain",
* zoneName: "contoso.com",
* resourceGroupName: example.name,
* ttl: 300,
* records: [{
* value: exampleStaticSiteCustomDomain.validationToken,
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_static_site = azure.appservice.StaticSite("example",
* name="example",
* resource_group_name=example.name,
* location=example.location)
* example_static_site_custom_domain = azure.appservice.StaticSiteCustomDomain("example",
* static_site_id=example_static_site.id,
* domain_name="my-domain.contoso.com",
* validation_type="dns-txt-token")
* example_txt_record = azure.dns.TxtRecord("example",
* name="_dnsauth.my-domain",
* zone_name="contoso.com",
* resource_group_name=example.name,
* ttl=300,
* records=[azure.dns.TxtRecordRecordArgs(
* value=example_static_site_custom_domain.validation_token,
* )])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var exampleStaticSite = new Azure.AppService.StaticSite("example", new()
* {
* Name = "example",
* ResourceGroupName = example.Name,
* Location = example.Location,
* });
* var exampleStaticSiteCustomDomain = new Azure.AppService.StaticSiteCustomDomain("example", new()
* {
* StaticSiteId = exampleStaticSite.Id,
* DomainName = "my-domain.contoso.com",
* ValidationType = "dns-txt-token",
* });
* var exampleTxtRecord = new Azure.Dns.TxtRecord("example", new()
* {
* Name = "_dnsauth.my-domain",
* ZoneName = "contoso.com",
* ResourceGroupName = example.Name,
* Ttl = 300,
* Records = new[]
* {
* new Azure.Dns.Inputs.TxtRecordRecordArgs
* {
* Value = exampleStaticSiteCustomDomain.ValidationToken,
* },
* },
* });
* });
* ```
* ```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-azure/sdk/v5/go/azure/dns"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-resources"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleStaticSite, err := appservice.NewStaticSite(ctx, "example", &appservice.StaticSiteArgs{
* Name: pulumi.String("example"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* })
* if err != nil {
* return err
* }
* exampleStaticSiteCustomDomain, err := appservice.NewStaticSiteCustomDomain(ctx, "example", &appservice.StaticSiteCustomDomainArgs{
* StaticSiteId: exampleStaticSite.ID(),
* DomainName: pulumi.String("my-domain.contoso.com"),
* ValidationType: pulumi.String("dns-txt-token"),
* })
* if err != nil {
* return err
* }
* _, err = dns.NewTxtRecord(ctx, "example", &dns.TxtRecordArgs{
* Name: pulumi.String("_dnsauth.my-domain"),
* ZoneName: pulumi.String("contoso.com"),
* ResourceGroupName: example.Name,
* Ttl: pulumi.Int(300),
* Records: dns.TxtRecordRecordArray{
* &dns.TxtRecordRecordArgs{
* Value: exampleStaticSiteCustomDomain.ValidationToken,
* },
* },
* })
* 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.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.appservice.StaticSite;
* import com.pulumi.azure.appservice.StaticSiteArgs;
* import com.pulumi.azure.appservice.StaticSiteCustomDomain;
* import com.pulumi.azure.appservice.StaticSiteCustomDomainArgs;
* import com.pulumi.azure.dns.TxtRecord;
* import com.pulumi.azure.dns.TxtRecordArgs;
* import com.pulumi.azure.dns.inputs.TxtRecordRecordArgs;
* 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
* var exampleStaticSite = new StaticSite("exampleStaticSite", StaticSiteArgs.builder()
* .name("example")
* .resourceGroupName(example.name())
* .location(example.location())
* .build());
* var exampleStaticSiteCustomDomain = new StaticSiteCustomDomain("exampleStaticSiteCustomDomain", StaticSiteCustomDomainArgs.builder()
* .staticSiteId(exampleStaticSite.id())
* .domainName("my-domain.contoso.com")
* .validationType("dns-txt-token")
* .build());
* var exampleTxtRecord = new TxtRecord("exampleTxtRecord", TxtRecordArgs.builder()
* .name("_dnsauth.my-domain")
* .zoneName("contoso.com")
* .resourceGroupName(example.name())
* .ttl(300)
* .records(TxtRecordRecordArgs.builder()
* .value(exampleStaticSiteCustomDomain.validationToken())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleStaticSite:
* type: azure:appservice:StaticSite
* name: example
* properties:
* name: example
* resourceGroupName: ${example.name}
* location: ${example.location}
* exampleStaticSiteCustomDomain:
* type: azure:appservice:StaticSiteCustomDomain
* name: example
* properties:
* staticSiteId: ${exampleStaticSite.id}
* domainName: my-domain.contoso.com
* validationType: dns-txt-token
* exampleTxtRecord:
* type: azure:dns:TxtRecord
* name: example
* properties:
* name: _dnsauth.my-domain
* zoneName: contoso.com
* resourceGroupName: ${example.name}
* ttl: 300
* records:
* - value: ${exampleStaticSiteCustomDomain.validationToken}
* ```
*
* ## Import
* Static Site Custom Domains can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:appservice/staticSiteCustomDomain:StaticSiteCustomDomain example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1/customDomains/name.contoso.com
* ```
* @property domainName The Domain Name which should be associated with this Static Site. Changing this forces a new Static Site Custom Domain to be created.
* @property staticSiteId The ID of the Static Site. Changing this forces a new Static Site Custom Domain to be created.
* @property validationType One of `cname-delegation` or `dns-txt-token`. Changing this forces a new Static Site Custom Domain to be created.
*/
public data class StaticSiteCustomDomainArgs(
public val domainName: Output? = null,
public val staticSiteId: Output? = null,
public val validationType: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.appservice.StaticSiteCustomDomainArgs =
com.pulumi.azure.appservice.StaticSiteCustomDomainArgs.builder()
.domainName(domainName?.applyValue({ args0 -> args0 }))
.staticSiteId(staticSiteId?.applyValue({ args0 -> args0 }))
.validationType(validationType?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [StaticSiteCustomDomainArgs].
*/
@PulumiTagMarker
public class StaticSiteCustomDomainArgsBuilder internal constructor() {
private var domainName: Output? = null
private var staticSiteId: Output? = null
private var validationType: Output? = null
/**
* @param value The Domain Name which should be associated with this Static Site. Changing this forces a new Static Site Custom Domain to be created.
*/
@JvmName("qvhgidxbegfldlbh")
public suspend fun domainName(`value`: Output) {
this.domainName = value
}
/**
* @param value The ID of the Static Site. Changing this forces a new Static Site Custom Domain to be created.
*/
@JvmName("bsayycmpmljehvxl")
public suspend fun staticSiteId(`value`: Output) {
this.staticSiteId = value
}
/**
* @param value One of `cname-delegation` or `dns-txt-token`. Changing this forces a new Static Site Custom Domain to be created.
*/
@JvmName("hecxpaspqhimvuxn")
public suspend fun validationType(`value`: Output) {
this.validationType = value
}
/**
* @param value The Domain Name which should be associated with this Static Site. Changing this forces a new Static Site Custom Domain to be created.
*/
@JvmName("dhoswlysoxdfyuhe")
public suspend fun domainName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.domainName = mapped
}
/**
* @param value The ID of the Static Site. Changing this forces a new Static Site Custom Domain to be created.
*/
@JvmName("bjpucgjchhsrqoca")
public suspend fun staticSiteId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.staticSiteId = mapped
}
/**
* @param value One of `cname-delegation` or `dns-txt-token`. Changing this forces a new Static Site Custom Domain to be created.
*/
@JvmName("gsvfaokgbscwesfd")
public suspend fun validationType(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.validationType = mapped
}
internal fun build(): StaticSiteCustomDomainArgs = StaticSiteCustomDomainArgs(
domainName = domainName,
staticSiteId = staticSiteId,
validationType = validationType,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy