aws / copilot-cli

The AWS Copilot CLI is a tool for developers to build, release and operate production ready containerized applications on AWS App Runner or Amazon ECS on AWS Fargate.
https://aws.github.io/copilot-cli/
Apache License 2.0
3.49k stars 403 forks source link

HTTPS setup with custom domain #1669

Open Fodoj opened 3 years ago

Fodoj commented 3 years ago

I am trying to do the following and looking for some tips on how to achieve it:

I have 2 environments, prod and preprod

preprod is available at preprod.myapp.io

prod is available at myapp.io

Currently I've added new listener to ALB created by Copilot and attached manually created ACM certification

Only problem is that application is still available at http, so it works both as http://myapp.io and https://myappio. I would like to at least redirect from http to https, ideally dont have http listener in the first place.

Is it something that can be done with the current version of Copilot?

efekarakus commented 3 years ago

Heya @Fodoj ! I wonder if something like this would work for you: https://github.com/datadotworld/amazon-ecs-cli-v2/commit/ad3752fa869120c4e0d8cb2d82bbaf747e599fe6

Fodoj commented 3 years ago

It seems that is bound to particular DNS names for the certificate: https://github.com/datadotworld/amazon-ecs-cli-v2/blob/ad3752fa869120c4e0d8cb2d82bbaf747e599fe6/templates/environment/cf.yml#L542, and I would like to just use the cert for root domain

iamhopaul123 commented 3 years ago

related to #1188