1. Packages
  2. Azure Classic
  3. API Docs
  4. containerapp
  5. CustomDomain

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

azure.containerapp.CustomDomain

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Manages a Container App Custom Domain.

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    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"])
    
    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
    	})
    }
    
    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 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.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}
    

    Create CustomDomain Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CustomDomain(name: string, args: CustomDomainArgs, opts?: CustomResourceOptions);
    @overload
    def CustomDomain(resource_name: str,
                     args: CustomDomainArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def CustomDomain(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     container_app_id: Optional[str] = None,
                     certificate_binding_type: Optional[str] = None,
                     container_app_environment_certificate_id: Optional[str] = None,
                     name: Optional[str] = None)
    func NewCustomDomain(ctx *Context, name string, args CustomDomainArgs, opts ...ResourceOption) (*CustomDomain, error)
    public CustomDomain(string name, CustomDomainArgs args, CustomResourceOptions? opts = null)
    public CustomDomain(String name, CustomDomainArgs args)
    public CustomDomain(String name, CustomDomainArgs args, CustomResourceOptions options)
    
    type: azure:containerapp:CustomDomain
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CustomDomainArgs
    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 CustomDomainArgs
    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 CustomDomainArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CustomDomainArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CustomDomainArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var azureCustomDomainResource = new Azure.ContainerApp.CustomDomain("azureCustomDomainResource", new()
    {
        ContainerAppId = "string",
        CertificateBindingType = "string",
        ContainerAppEnvironmentCertificateId = "string",
        Name = "string",
    });
    
    example, err := containerapp.NewCustomDomain(ctx, "azureCustomDomainResource", &containerapp.CustomDomainArgs{
    	ContainerAppId:                       pulumi.String("string"),
    	CertificateBindingType:               pulumi.String("string"),
    	ContainerAppEnvironmentCertificateId: pulumi.String("string"),
    	Name:                                 pulumi.String("string"),
    })
    
    var azureCustomDomainResource = new CustomDomain("azureCustomDomainResource", CustomDomainArgs.builder()
        .containerAppId("string")
        .certificateBindingType("string")
        .containerAppEnvironmentCertificateId("string")
        .name("string")
        .build());
    
    azure_custom_domain_resource = azure.containerapp.CustomDomain("azureCustomDomainResource",
        container_app_id="string",
        certificate_binding_type="string",
        container_app_environment_certificate_id="string",
        name="string")
    
    const azureCustomDomainResource = new azure.containerapp.CustomDomain("azureCustomDomainResource", {
        containerAppId: "string",
        certificateBindingType: "string",
        containerAppEnvironmentCertificateId: "string",
        name: "string",
    });
    
    type: azure:containerapp:CustomDomain
    properties:
        certificateBindingType: string
        containerAppEnvironmentCertificateId: string
        containerAppId: string
        name: string
    

    CustomDomain Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The CustomDomain resource accepts the following input properties:

    ContainerAppId string
    The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
    CertificateBindingType string
    The Binding type. Possible values include Disabled and SniEnabled.
    ContainerAppEnvironmentCertificateId string

    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.

    Name string

    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 for more information.

    ContainerAppId string
    The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
    CertificateBindingType string
    The Binding type. Possible values include Disabled and SniEnabled.
    ContainerAppEnvironmentCertificateId string

    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.

    Name string

    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 for more information.

    containerAppId String
    The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
    certificateBindingType String
    The Binding type. Possible values include Disabled and SniEnabled.
    containerAppEnvironmentCertificateId String

    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.

    name String

    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 for more information.

    containerAppId string
    The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
    certificateBindingType string
    The Binding type. Possible values include Disabled and SniEnabled.
    containerAppEnvironmentCertificateId string

    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.

    name string

    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 for more information.

    container_app_id str
    The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
    certificate_binding_type str
    The Binding type. Possible values include Disabled and SniEnabled.
    container_app_environment_certificate_id str

    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.

    name str

    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 for more information.

    containerAppId String
    The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
    certificateBindingType String
    The Binding type. Possible values include Disabled and SniEnabled.
    containerAppEnvironmentCertificateId String

    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.

    name String

    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 for more information.

    Outputs

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

    ContainerAppEnvironmentManagedCertificateId string
    The ID of the Container App Environment Managed Certificate to use.
    Id string
    The provider-assigned unique ID for this managed resource.
    ContainerAppEnvironmentManagedCertificateId string
    The ID of the Container App Environment Managed Certificate to use.
    Id string
    The provider-assigned unique ID for this managed resource.
    containerAppEnvironmentManagedCertificateId String
    The ID of the Container App Environment Managed Certificate to use.
    id String
    The provider-assigned unique ID for this managed resource.
    containerAppEnvironmentManagedCertificateId string
    The ID of the Container App Environment Managed Certificate to use.
    id string
    The provider-assigned unique ID for this managed resource.
    container_app_environment_managed_certificate_id str
    The ID of the Container App Environment Managed Certificate to use.
    id str
    The provider-assigned unique ID for this managed resource.
    containerAppEnvironmentManagedCertificateId String
    The ID of the Container App Environment Managed Certificate to use.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing CustomDomain Resource

    Get an existing CustomDomain 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?: CustomDomainState, opts?: CustomResourceOptions): CustomDomain
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            certificate_binding_type: Optional[str] = None,
            container_app_environment_certificate_id: Optional[str] = None,
            container_app_environment_managed_certificate_id: Optional[str] = None,
            container_app_id: Optional[str] = None,
            name: Optional[str] = None) -> CustomDomain
    func GetCustomDomain(ctx *Context, name string, id IDInput, state *CustomDomainState, opts ...ResourceOption) (*CustomDomain, error)
    public static CustomDomain Get(string name, Input<string> id, CustomDomainState? state, CustomResourceOptions? opts = null)
    public static CustomDomain get(String name, Output<String> id, CustomDomainState 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:
    CertificateBindingType string
    The Binding type. Possible values include Disabled and SniEnabled.
    ContainerAppEnvironmentCertificateId string

    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.

    ContainerAppEnvironmentManagedCertificateId string
    The ID of the Container App Environment Managed Certificate to use.
    ContainerAppId string
    The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
    Name string

    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 for more information.

    CertificateBindingType string
    The Binding type. Possible values include Disabled and SniEnabled.
    ContainerAppEnvironmentCertificateId string

    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.

    ContainerAppEnvironmentManagedCertificateId string
    The ID of the Container App Environment Managed Certificate to use.
    ContainerAppId string
    The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
    Name string

    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 for more information.

    certificateBindingType String
    The Binding type. Possible values include Disabled and SniEnabled.
    containerAppEnvironmentCertificateId String

    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.

    containerAppEnvironmentManagedCertificateId String
    The ID of the Container App Environment Managed Certificate to use.
    containerAppId String
    The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
    name String

    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 for more information.

    certificateBindingType string
    The Binding type. Possible values include Disabled and SniEnabled.
    containerAppEnvironmentCertificateId string

    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.

    containerAppEnvironmentManagedCertificateId string
    The ID of the Container App Environment Managed Certificate to use.
    containerAppId string
    The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
    name string

    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 for more information.

    certificate_binding_type str
    The Binding type. Possible values include Disabled and SniEnabled.
    container_app_environment_certificate_id str

    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.

    container_app_environment_managed_certificate_id str
    The ID of the Container App Environment Managed Certificate to use.
    container_app_id str
    The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
    name str

    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 for more information.

    certificateBindingType String
    The Binding type. Possible values include Disabled and SniEnabled.
    containerAppEnvironmentCertificateId String

    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.

    containerAppEnvironmentManagedCertificateId String
    The ID of the Container App Environment Managed Certificate to use.
    containerAppId String
    The ID of the Container App to which this Custom Domain should be bound. Changing this forces a new resource to be created.
    name String

    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 for more information.

    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"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi