Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.containerapp.kotlin
import com.pulumi.azure.containerapp.CustomDomainArgs.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 Container App Custom Domain.
* ## Example Usage
*
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleZone:
* type: azure:dns:Zone
* name: example
* properties:
* name: contoso.com
* resourceGroupName: ${example.name}
* exampleTxtRecord:
* type: azure:dns:TxtRecord
* name: example
* properties:
* name: asuid.example
* resourceGroupName: ${exampleZone.resourceGroupName}
* zoneName: ${exampleZone.name}
* ttl: 300
* records:
* - value: ${exampleApp.customDomainVerificationId}
* exampleAnalyticsWorkspace:
* type: azure:operationalinsights:AnalyticsWorkspace
* name: example
* properties:
* name: example
* location: ${example.location}
* resourceGroupName: ${example.name}
* sku: PerGB2018
* retentionInDays: 30
* exampleEnvironment:
* type: azure:containerapp:Environment
* name: example
* properties:
* name: Example-Environment
* location: ${example.location}
* resourceGroupName: ${example.name}
* logAnalyticsWorkspaceId: ${exampleAnalyticsWorkspace.id}
* exampleEnvironmentCertificate:
* type: azure:containerapp:EnvironmentCertificate
* name: example
* properties:
* name: myfriendlyname
* containerAppEnvironmentId: ${exampleEnvironment.id}
* certificateBlob:
* fn::invoke:
* Function: std:filebase64
* Arguments:
* input: path/to/certificate_file.pfx
* Return: result
* certificatePassword: $3cretSqu1rreL
* exampleApp:
* type: azure:containerapp:App
* name: example
* properties:
* name: example-app
* containerAppEnvironmentId: ${exampleEnvironment.id}
* resourceGroupName: ${example.name}
* revisionMode: Single
* template:
* containers:
* - name: examplecontainerapp
* image: mcr.microsoft.com/k8se/quickstart:latest
* cpu: 0.25
* memory: 0.5Gi
* ingress:
* allowInsecureConnections: false
* externalEnabled: true
* targetPort: 5000
* transport: http
* trafficWeights:
* - latestRevision: true
* percentage: 100
* exampleCustomDomain:
* type: azure:containerapp:CustomDomain
* name: example
* properties:
* name:
* fn::invoke:
* Function: std:trimprefix
* Arguments:
* input: ${exampleTxtRecord.fqdn}
* prefix: asuid.
* Return: result
* containerAppId: ${exampleApp.id}
* containerAppEnvironmentCertificateId: ${exampleEnvironmentCertificate.id}
* certificateBindingType: SniEnabled
* ```
*
* ### Managed Certificate
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* import * as std from "@pulumi/std";
* const example = new azure.containerapp.CustomDomain("example", {
* name: std.trimprefix({
* input: exampleAzurermDnsTxtRecord.fqdn,
* prefix: "asuid.",
* }).then(invoke => invoke.result),
* containerAppId: exampleAzurermContainerApp.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* import pulumi_std as std
* example = azure.containerapp.CustomDomain("example",
* name=std.trimprefix(input=example_azurerm_dns_txt_record["fqdn"],
* prefix="asuid.").result,
* container_app_id=example_azurerm_container_app["id"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* using Std = Pulumi.Std;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.ContainerApp.CustomDomain("example", new()
* {
* Name = Std.Trimprefix.Invoke(new()
* {
* Input = exampleAzurermDnsTxtRecord.Fqdn,
* Prefix = "asuid.",
* }).Apply(invoke => invoke.Result),
* ContainerAppId = exampleAzurermContainerApp.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp"
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* invokeTrimprefix, err := std.Trimprefix(ctx, &std.TrimprefixArgs{
* Input: exampleAzurermDnsTxtRecord.Fqdn,
* Prefix: "asuid.",
* }, nil)
* if err != nil {
* return err
* }
* _, err = containerapp.NewCustomDomain(ctx, "example", &containerapp.CustomDomainArgs{
* Name: pulumi.String(invokeTrimprefix.Result),
* ContainerAppId: pulumi.Any(exampleAzurermContainerApp.Id),
* })
* 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.containerapp.CustomDomain;
* import com.pulumi.azure.containerapp.CustomDomainArgs;
* 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 CustomDomain("example", CustomDomainArgs.builder()
* .name(StdFunctions.trimprefix(TrimprefixArgs.builder()
* .input(exampleAzurermDnsTxtRecord.fqdn())
* .prefix("asuid.")
* .build()).result())
* .containerAppId(exampleAzurermContainerApp.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:containerapp:CustomDomain
* properties:
* name:
* fn::invoke:
* Function: std:trimprefix
* Arguments:
* input: ${exampleAzurermDnsTxtRecord.fqdn}
* prefix: asuid.
* Return: result
* containerAppId: ${exampleAzurermContainerApp.id}
* ```
*
* ## Import
* A Container App Custom Domain can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:containerapp/customDomain:CustomDomain example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.App/containerApps/myContainerApp/customDomainName/mycustomdomain.example.com"
* ```
* @property certificateBindingType The Binding type. Possible values include `Disabled` and `SniEnabled`.
* @property containerAppEnvironmentCertificateId The ID of the Container App Environment Certificate to use. Changing this forces a new resource to be created.
* > **NOTE:** Omit this value if you wish to use an Azure Managed certificate. You must create the relevant DNS verification steps before this process will be successful.
* @property containerAppId The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
* @property name The fully qualified name of the Custom Domain. Must be the CN or a named SAN in the certificate specified by the `container_app_environment_certificate_id`. Changing this forces a new resource to be created.
* > **Note:** The Custom Domain verification TXT record requires a prefix of `asuid.`, however, this must be trimmed from the `name` property here. See the [official docs](https://learn.microsoft.com/en-us/azure/container-apps/custom-domains-certificates) for more information.
*/
public data class CustomDomainArgs(
public val certificateBindingType: Output? = null,
public val containerAppEnvironmentCertificateId: Output? = null,
public val containerAppId: Output? = null,
public val name: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.containerapp.CustomDomainArgs =
com.pulumi.azure.containerapp.CustomDomainArgs.builder()
.certificateBindingType(certificateBindingType?.applyValue({ args0 -> args0 }))
.containerAppEnvironmentCertificateId(
containerAppEnvironmentCertificateId?.applyValue({ args0 ->
args0
}),
)
.containerAppId(containerAppId?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [CustomDomainArgs].
*/
@PulumiTagMarker
public class CustomDomainArgsBuilder internal constructor() {
private var certificateBindingType: Output? = null
private var containerAppEnvironmentCertificateId: Output? = null
private var containerAppId: Output? = null
private var name: Output? = null
/**
* @param value The Binding type. Possible values include `Disabled` and `SniEnabled`.
*/
@JvmName("vnhslihhuraseryp")
public suspend fun certificateBindingType(`value`: Output) {
this.certificateBindingType = value
}
/**
* @param value The ID of the Container App Environment Certificate to use. Changing this forces a new resource to be created.
* > **NOTE:** Omit this value if you wish to use an Azure Managed certificate. You must create the relevant DNS verification steps before this process will be successful.
*/
@JvmName("rsunllvjomwmophs")
public suspend fun containerAppEnvironmentCertificateId(`value`: Output) {
this.containerAppEnvironmentCertificateId = value
}
/**
* @param value The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
*/
@JvmName("qyuywxktuopywyod")
public suspend fun containerAppId(`value`: Output) {
this.containerAppId = value
}
/**
* @param value The fully qualified name of the Custom Domain. Must be the CN or a named SAN in the certificate specified by the `container_app_environment_certificate_id`. Changing this forces a new resource to be created.
* > **Note:** The Custom Domain verification TXT record requires a prefix of `asuid.`, however, this must be trimmed from the `name` property here. See the [official docs](https://learn.microsoft.com/en-us/azure/container-apps/custom-domains-certificates) for more information.
*/
@JvmName("xqisvkjflolwbvof")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The Binding type. Possible values include `Disabled` and `SniEnabled`.
*/
@JvmName("akrsqkpdiowtpkdg")
public suspend fun certificateBindingType(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.certificateBindingType = mapped
}
/**
* @param value The ID of the Container App Environment Certificate to use. Changing this forces a new resource to be created.
* > **NOTE:** Omit this value if you wish to use an Azure Managed certificate. You must create the relevant DNS verification steps before this process will be successful.
*/
@JvmName("smkxwmhildujykwo")
public suspend fun containerAppEnvironmentCertificateId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.containerAppEnvironmentCertificateId = mapped
}
/**
* @param value The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
*/
@JvmName("tddiomtvpnsbwyxm")
public suspend fun containerAppId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.containerAppId = mapped
}
/**
* @param value The fully qualified name of the Custom Domain. Must be the CN or a named SAN in the certificate specified by the `container_app_environment_certificate_id`. Changing this forces a new resource to be created.
* > **Note:** The Custom Domain verification TXT record requires a prefix of `asuid.`, however, this must be trimmed from the `name` property here. See the [official docs](https://learn.microsoft.com/en-us/azure/container-apps/custom-domains-certificates) for more information.
*/
@JvmName("eljebvctvdalurml")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
internal fun build(): CustomDomainArgs = CustomDomainArgs(
certificateBindingType = certificateBindingType,
containerAppEnvironmentCertificateId = containerAppEnvironmentCertificateId,
containerAppId = containerAppId,
name = name,
)
}