copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Alternate Domain Names not being set on Cloudfront

Open ssyberg opened this issue 1 year ago • 1 comments

Description:

I added a cdn to an existing deployment, it's being created just fine, the SSL certificate is working, but there are no domain names being added to the Alternate Domain Names and as such nothing resolves properly. If I add them manually it works. I've tried specifying an http.alias section explicitly in the env manifest but it makes no difference. Is this expected behavior to add these manually? I would have thought it would add the alias' defined in the http services.

Environment Manifest:

name: staging
type: Environment

cdn:
    certificate: arn:aws:acm:us-east-1:<redated>:certificate/a0fe4117-8d5f-4e17-a82e-67f09ddea510
    terminate_tls: true

http:
    alias:
        - '${COPILOT_ENVIRONMENT_NAME}.example.com'
        - '${COPILOT_ENVIRONMENT_NAME}.foo.example.com'
    public:
        ingress:
            cdn: true

observability:
    container_insights: true # Enable CloudWatch Container Insights for your environment.

ssyberg avatar Jun 20 '24 13:06 ssyberg

If you are importing certificate to the cdn, then yes - you will be responsible with adding the A-records that point to the distribution. If you the aliases that you are intended to use are subdomains of the domain that you specified with copilot app init --domain, then you shouldn't need to specify cdn.certificate. Copilot will automatically point your http services' http.alias to the distribution.

Lou1415926 avatar Jun 24 '24 16:06 Lou1415926

If you are importing certificate to the cdn, then yes - you will be responsible with adding the A-records that point to the distribution.

To clarify, I'm not talking about DNS records, they are hosted elsewhere so I'm not using this accounts Route53 for this. I already have created and validated a certificate that I'm specifying as you see above. The issue is when creating the distribution, copilot is not adding all of the domains specified in the certificate or specified in http.alias. This seems wrong to me but am I supposed to just add these manually here? image

ssyberg avatar Jul 26 '24 11:07 ssyberg

Last time I deployed this it seemed to work, I'm closing this for now. Not sure what was going on before.

ssyberg avatar Jul 29 '24 17:07 ssyberg