Terraform- Resource: aws_apprunner_custom_domain_association
Example Usage
resource "aws_apprunner_custom_domain_association" "example" {
domain_name = "example.com"
service_arn = aws_apprunner_service.example.arn
}
Argument Reference
The following arguments supported:
domain_name
- (Required) 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) ARN of the App Runner service.
Attributes Reference
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
- 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 toSUCCESS
after App Runner completes validation with your DNS.type
- Record type, alwaysCNAME
.value
- 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.,
$ terraform import aws_apprunner_custom_domain_association.example example.com,arn:aws:apprunner:us-east-1:123456789012:service/example-
app/8fe1e10304f84fd2b0df550fe98a71fa