CustomDomainArgs

data class CustomDomainArgs(val certificateBindingType: Output<String>? = null, val containerAppEnvironmentCertificateId: Output<String>? = null, val containerAppId: Output<String>? = null, val name: Output<String>? = null) : ConvertibleToJava<CustomDomainArgs>

Manages a Container App Custom Domain.

Example Usage

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:trimsuffix
arguments:
input:
fn::invoke:
function: std:trimprefix
arguments:
input: ${api.fqdn}
prefix: asuid.
return: result
suffix: .
return: result
containerAppId: ${exampleApp.id}
containerAppEnvironmentCertificateId: ${exampleEnvironmentCertificate.id}
certificateBindingType: SniEnabled

Managed Certificate

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: api.fqdn,
prefix: "asuid.",
}).then(invoke => std.trimsuffix({
input: invoke.result,
suffix: ".",
})).then(invoke => invoke.result),
containerAppId: exampleAzurermContainerApp.id,
});
import pulumi
import pulumi_azure as azure
import pulumi_std as std
example = azure.containerapp.CustomDomain("example",
name=std.trimsuffix(input=std.trimprefix(input=api["fqdn"],
prefix="asuid.").result,
suffix=".").result,
container_app_id=example_azurerm_container_app["id"])
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 = api.Fqdn,
Prefix = "asuid.",
}).Apply(invoke => Std.Trimsuffix.Invoke(new()
{
Input = invoke.Result,
Suffix = ".",
})).Apply(invoke => invoke.Result),
ContainerAppId = exampleAzurermContainerApp.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/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 {
invokeTrimsuffix, err := std.Trimsuffix(ctx, &std.TrimsuffixArgs{
Input: std.Trimprefix(ctx, &std.TrimprefixArgs{
Input: api.Fqdn,
Prefix: "asuid.",
}, nil).Result,
Suffix: ".",
}, nil)
if err != nil {
return err
}
_, err = containerapp.NewCustomDomain(ctx, "example", &containerapp.CustomDomainArgs{
Name: pulumi.String(invokeTrimsuffix.Result),
ContainerAppId: pulumi.Any(exampleAzurermContainerApp.Id),
})
if err != nil {
return err
}
return nil
})
}
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 com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.TrimprefixArgs;
import com.pulumi.std.inputs.TrimsuffixArgs;
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.trimsuffix(TrimsuffixArgs.builder()
.input(StdFunctions.trimprefix(TrimprefixArgs.builder()
.input(api.fqdn())
.prefix("asuid.")
.build()).result())
.suffix(".")
.build()).result())
.containerAppId(exampleAzurermContainerApp.id())
.build());
}
}
resources:
example:
type: azure:containerapp:CustomDomain
properties:
name:
fn::invoke:
function: std:trimsuffix
arguments:
input:
fn::invoke:
function: std:trimprefix
arguments:
input: ${api.fqdn}
prefix: asuid.
return: result
suffix: .
return: result
containerAppId: ${exampleAzurermContainerApp.id}

API Providers

This resource uses the following Azure API Providers:

  • Microsoft.App: 2025-01-01

Import

A Container App Custom Domain can be imported using the resource id, e.g.

$ pulumi import azure:containerapp/customDomain:CustomDomain example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.App/containerApps/myContainerApp/customDomainName/mycustomdomain.example.com"

Constructors

Link copied to clipboard
constructor(certificateBindingType: Output<String>? = null, containerAppEnvironmentCertificateId: Output<String>? = null, containerAppId: Output<String>? = null, name: Output<String>? = null)

Properties

Link copied to clipboard
val certificateBindingType: Output<String>? = null

The Binding type. Possible values include Disabled and SniEnabled.

Link copied to clipboard

The ID of the Container App Environment Certificate to use. Changing this forces a new resource to be created.

Link copied to clipboard
val containerAppId: Output<String>? = null

The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.

Link copied to clipboard
val name: Output<String>? = null

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.

Functions

Link copied to clipboard
open override fun toJava(): CustomDomainArgs