AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Monday, Jul 11, 2022 by Pulumi

CustomDomainAssociation

Manages an App Runner Custom Domain association.

NOTE: After creation, you must use the information in the certification_validation_records attribute to add CNAME records to your Domain Name System (DNS). For each mapped domain name, add a mapping to the target App Runner subdomain (found in the dns_target attribute) and one or more certificate validation records. App Runner then performs DNS validation to verify that you own or control the domain name you associated. App Runner tracks domain validity in a certificate stored in AWS Certificate Manager (ACM).

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.AppRunner.CustomDomainAssociation("example", new Aws.AppRunner.CustomDomainAssociationArgs
        {
            DomainName = "example.com",
            ServiceArn = aws_apprunner_service.Example.Arn,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/apprunner"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apprunner.NewCustomDomainAssociation(ctx, "example", &apprunner.CustomDomainAssociationArgs{
			DomainName: pulumi.String("example.com"),
			ServiceArn: pulumi.Any(aws_apprunner_service.Example.Arn),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new CustomDomainAssociation("example", CustomDomainAssociationArgs.builder()        
            .domainName("example.com")
            .serviceArn(aws_apprunner_service.example().arn())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.apprunner.CustomDomainAssociation("example",
    domain_name="example.com",
    service_arn=aws_apprunner_service["example"]["arn"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.apprunner.CustomDomainAssociation("example", {
    domainName: "example.com",
    serviceArn: aws_apprunner_service.example.arn,
});
resources:
  example:
    type: aws:apprunner:CustomDomainAssociation
    properties:
      domainName: example.com
      serviceArn: ${aws_apprunner_service.example.arn}

Create a CustomDomainAssociation Resource

new CustomDomainAssociation(name: string, args: CustomDomainAssociationArgs, opts?: CustomResourceOptions);
@overload
def CustomDomainAssociation(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            domain_name: Optional[str] = None,
                            enable_www_subdomain: Optional[bool] = None,
                            service_arn: Optional[str] = None)
@overload
def CustomDomainAssociation(resource_name: str,
                            args: CustomDomainAssociationArgs,
                            opts: Optional[ResourceOptions] = None)
func NewCustomDomainAssociation(ctx *Context, name string, args CustomDomainAssociationArgs, opts ...ResourceOption) (*CustomDomainAssociation, error)
public CustomDomainAssociation(string name, CustomDomainAssociationArgs args, CustomResourceOptions? opts = null)
public CustomDomainAssociation(String name, CustomDomainAssociationArgs args)
public CustomDomainAssociation(String name, CustomDomainAssociationArgs args, CustomResourceOptions options)
type: aws:apprunner:CustomDomainAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

CustomDomainAssociation Resource Properties

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

Inputs

The CustomDomainAssociation resource accepts the following input properties:

DomainName string

The custom domain endpoint to association. Specify a base domain e.g., example.com or a subdomain e.g., subdomain.example.com.

ServiceArn string

The ARN of the App Runner service.

EnableWwwSubdomain bool

Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.

DomainName string

The custom domain endpoint to association. Specify a base domain e.g., example.com or a subdomain e.g., subdomain.example.com.

ServiceArn string

The ARN of the App Runner service.

EnableWwwSubdomain bool

Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.

domainName String

The custom domain endpoint to association. Specify a base domain e.g., example.com or a subdomain e.g., subdomain.example.com.

serviceArn String

The ARN of the App Runner service.

enableWwwSubdomain Boolean

Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.

domainName string

The custom domain endpoint to association. Specify a base domain e.g., example.com or a subdomain e.g., subdomain.example.com.

serviceArn string

The ARN of the App Runner service.

enableWwwSubdomain boolean

Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.

domain_name str

The custom domain endpoint to association. Specify a base domain e.g., example.com or a subdomain e.g., subdomain.example.com.

service_arn str

The ARN of the App Runner service.

enable_www_subdomain bool

Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.

domainName String

The custom domain endpoint to association. Specify a base domain e.g., example.com or a subdomain e.g., subdomain.example.com.

serviceArn String

The ARN of the App Runner service.

enableWwwSubdomain Boolean

Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.

Outputs

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

CertificateValidationRecords List<CustomDomainAssociationCertificateValidationRecord>

A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.

DnsTarget string

The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

CertificateValidationRecords []CustomDomainAssociationCertificateValidationRecord

A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.

DnsTarget string

The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

certificateValidationRecords List<CustomDomainAssociationCertificateValidationRecord>

A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.

dnsTarget String

The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.

id String

The provider-assigned unique ID for this managed resource.

status String

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

certificateValidationRecords CustomDomainAssociationCertificateValidationRecord[]

A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.

dnsTarget string

The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.

id string

The provider-assigned unique ID for this managed resource.

status string

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

certificate_validation_records Sequence[CustomDomainAssociationCertificateValidationRecord]

A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.

dns_target str

The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.

id str

The provider-assigned unique ID for this managed resource.

status str

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

certificateValidationRecords List<Property Map>

A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.

dnsTarget String

The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.

id String

The provider-assigned unique ID for this managed resource.

status String

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

Look up an Existing CustomDomainAssociation Resource

Get an existing CustomDomainAssociation 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?: CustomDomainAssociationState, opts?: CustomResourceOptions): CustomDomainAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        certificate_validation_records: Optional[Sequence[CustomDomainAssociationCertificateValidationRecordArgs]] = None,
        dns_target: Optional[str] = None,
        domain_name: Optional[str] = None,
        enable_www_subdomain: Optional[bool] = None,
        service_arn: Optional[str] = None,
        status: Optional[str] = None) -> CustomDomainAssociation
func GetCustomDomainAssociation(ctx *Context, name string, id IDInput, state *CustomDomainAssociationState, opts ...ResourceOption) (*CustomDomainAssociation, error)
public static CustomDomainAssociation Get(string name, Input<string> id, CustomDomainAssociationState? state, CustomResourceOptions? opts = null)
public static CustomDomainAssociation get(String name, Output<String> id, CustomDomainAssociationState 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:
CertificateValidationRecords List<CustomDomainAssociationCertificateValidationRecordArgs>

A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.

DnsTarget string

The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.

DomainName string

The custom domain endpoint to association. Specify a base domain e.g., example.com or a subdomain e.g., subdomain.example.com.

EnableWwwSubdomain bool

Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.

ServiceArn string

The ARN of the App Runner service.

Status string

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

CertificateValidationRecords []CustomDomainAssociationCertificateValidationRecordArgs

A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.

DnsTarget string

The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.

DomainName string

The custom domain endpoint to association. Specify a base domain e.g., example.com or a subdomain e.g., subdomain.example.com.

EnableWwwSubdomain bool

Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.

ServiceArn string

The ARN of the App Runner service.

Status string

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

certificateValidationRecords List<CustomDomainAssociationCertificateValidationRecordArgs>

A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.

dnsTarget String

The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.

domainName String

The custom domain endpoint to association. Specify a base domain e.g., example.com or a subdomain e.g., subdomain.example.com.

enableWwwSubdomain Boolean

Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.

serviceArn String

The ARN of the App Runner service.

status String

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

certificateValidationRecords CustomDomainAssociationCertificateValidationRecordArgs[]

A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.

dnsTarget string

The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.

domainName string

The custom domain endpoint to association. Specify a base domain e.g., example.com or a subdomain e.g., subdomain.example.com.

enableWwwSubdomain boolean

Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.

serviceArn string

The ARN of the App Runner service.

status string

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

certificate_validation_records Sequence[CustomDomainAssociationCertificateValidationRecordArgs]

A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.

dns_target str

The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.

domain_name str

The custom domain endpoint to association. Specify a base domain e.g., example.com or a subdomain e.g., subdomain.example.com.

enable_www_subdomain bool

Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.

service_arn str

The ARN of the App Runner service.

status str

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

certificateValidationRecords List<Property Map>

A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.

dnsTarget String

The App Runner subdomain of the App Runner service. The custom domain name is mapped to this target name. Attribute only available if resource created (not imported) with this provider.

domainName String

The custom domain endpoint to association. Specify a base domain e.g., example.com or a subdomain e.g., subdomain.example.com.

enableWwwSubdomain Boolean

Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.

serviceArn String

The ARN of the App Runner service.

status String

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

Supporting Types

CustomDomainAssociationCertificateValidationRecord

Name string

The certificate CNAME record name.

Status string

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

Type string

The record type, always CNAME.

Value string

The certificate CNAME record value.

Name string

The certificate CNAME record name.

Status string

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

Type string

The record type, always CNAME.

Value string

The certificate CNAME record value.

name String

The certificate CNAME record name.

status String

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

type String

The record type, always CNAME.

value String

The certificate CNAME record value.

name string

The certificate CNAME record name.

status string

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

type string

The record type, always CNAME.

value string

The certificate CNAME record value.

name str

The certificate CNAME record name.

status str

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

type str

The record type, always CNAME.

value str

The certificate CNAME record value.

name String

The certificate CNAME record name.

status String

The current state of the certificate CNAME record validation. It should change to SUCCESS after App Runner completes validation with your DNS.

type String

The record type, always CNAME.

value String

The certificate CNAME record value.

Import

App Runner Custom Domain Associations can be imported by using the domain_name and service_arn separated by a comma (,), e.g.,

 $ pulumi import aws:apprunner/customDomainAssociation:CustomDomainAssociation example example.com,arn:aws:apprunner:us-east-1:123456789012:service/example-

app/8fe1e10304f84fd2b0df550fe98a71fa

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.