AWS App Runner Custom Domain Association
This page shows how to write Terraform for App Runner Custom Domain Association and write them securely.
aws_apprunner_custom_domain_association (Terraform)
The Custom Domain Association in App Runner can be configured in Terraform with the resource name aws_apprunner_custom_domain_association
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
The following arguments supported:
domain_name
- (Required) 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
(Optional) Whether to associate the subdomain with the App Runner service in addition to the base domain. Defaults totrue
.service_arn
- (Required) The ARN of the App Runner service.
In addition to all arguments above, the following attributes are exported:
id
- Thedomain_name
andservice_arn
separated by a comma (,
).certificate_validation_records
- A set of certificate CNAME records used for this domain name. See Certificate Validation Records below for more details.dns_target
- 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 Terraform.
Explanation in Terraform Registry
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 thedns_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).
CloudFormation Example
CloudFormation code does not have the related resource.