Skip to content

Support for environment-specific app domains #3293

Open
@programmablemike

Description

description

We're trying to setup a multi-account, multi-domain deployment where we have a single (global) Application account and then each Copilot Environment (eg. dev, test, staging, production) is deployed into a separate AWS account w/ a custom domain registered in that account.

To produce the following environment --> domain map:

dev --> service1.myapp.dev
test --> service1.myapp.net
staging --> service1.myapp.io
production --> service1.myapp.com

Our reasoning behind using a separate domain per environment is for security - to hedge against subdomain takeover attacks and to take advantage of the site isolation protections that are becoming more prevalent in modern browsers.

current behavior

Trying to do a copilot svc deploy with ENV.http.alias set to a custom domain without that domain registered in the application causes the following error and aborts deployment.

✘ To use `http.alias`, your application must be associated with a domain: `copilot app init --domain example.com`.
✘ deploy service <service-name> to environment staging: alias specified when application is not associated with a domain

desired behavior

Ideally what I'd like to do is register all the possible custom domains using copilot app init myapp --domain myapp.dev,myapp.net,myapp.io,myapp.com and then specify the domain for each environment by setting ENV.http.alias in the Copilot Service manifest, or have the ability to toggle off the check for the application/custom domain during copilot svc deploy.

references

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area/envIssues about environments.size/LWe should be able to deliver roughly a large in 2-3 sprints.type/featureIssues that are new feature requests.type/requestIssues that are created by customers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions