Skip to content

Resource: awsApprunnerCustomDomainAssociation

Manages an App Runner Custom Domain association.

\~> NOTE: After creation, you must use the information in the certificationValidationRecords 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 dnsTarget 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

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.apprunnerCustomDomainAssociation.ApprunnerCustomDomainAssociation(
  this,
  "example",
  {
    domainName: "example.com",
    serviceArn: "${aws_apprunner_service.example.arn}",
  }
);

Argument Reference

The following arguments supported:

  • domainName - (Required) Custom domain endpoint to association. Specify a base domain e.g., exampleCom or a subdomain e.g., subdomainExampleCom.
  • enableWwwSubdomain (Optional) Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults to true.
  • serviceArn - (Required) ARN of the App Runner service.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The domainName and serviceArn separated by a comma (,).
  • certificateValidationRecords - A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.
  • dnsTarget - 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 Terraform.

Certificate Validation Records

The configuration block consists of the following arguments:

  • name - Certificate CNAME record name.
  • status - Current state of the certificate CNAME record validation. It should change to success after App Runner completes validation with your DNS.
  • type - Record type, always cname.
  • value - Certificate CNAME record value.

Import

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

$ terraform import aws_apprunner_custom_domain_association.example example.com,arn:aws:apprunner:us-east-1:123456789012:service/example-
app/8fe1e10304f84fd2b0df550fe98a71fa