Upsert records to the Copilot-managed hosted zone if `http.alias` is detected to be a managed subdomain
There are a lot of ways to enable an alias in http.alias:
- Associate a domain with
app init --domain example.com. Any service in the application will be able to use, at least example.com, *.example.com, *.app.example.com. - Import an ACM certificate to the environment. Any service deployed in the environment will be able to use any alias covered by the ACM certificate.
- Import an ALB that has an HTTPS listener associated with a certificate. The service that imports the ALB can use any alias covered by the associated certificate.
Scenario 2 and 3 requires users to upsert the A records for their alias on their own, OR specify the hosted_zone field so that Copilot knows where to upsert the records.
It'd be an UX improvement if Copilot can tell if the http.alias is one of the domain enabled in scenario 1 (i.e. example.com, *.example.com, *.app.example.com), and upsert the A records to the respective hosted zone automatically without needing the http.hosted_zone field.
Related: #5438
With regards to scenario 2, if an AWS org has an ACM cert set up with a domain (e.g. app.example.com), can we deploy an existing environment with the imported ACM, then add the alias to an existing app within that service to marry up the listeners? I've seen references to having to delete and reinitialise an app to pick up domains, but is the imported ACM a work around? Thanks