aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
457 stars 115 forks source link

Rewrites and redirects per environment #2204

Open watilde opened 3 years ago

watilde commented 3 years ago

Is your feature request related to a problem? Please describe. As a developer, I want to test redirection rules for only dev environment so that I do not affect production environment.

Describe the solution you'd like Having an option "environment" to rewrite and redirects.

Alternative solutions 1) Having an environment variable 2) Set environment query string with https://github.com/aws-amplify/amplify-console/issues/97#issuecomment-906172145

Additional context A user wants to build an app on ECS on the same domain with the other app on ECS. They are considering to design Multi Origin with CloudFront, but it'd be easier if Rewrites and redirects can connect to an endpoint of ALB. In addition, their Amplify app has dev, prod environment and using environment variable to set into target address would unblock the challenge.

swaminator commented 3 years ago

This is currently not possible. As a workaround, you can create two apps within Amplify console - Prod and Dev. Your Prod app will only have your production branch, and your dev app can contain all your staging and feature branches.

wgins commented 3 years ago

+1 to this

m1stermanager commented 2 years ago

this would be a great feature. as long as two amplify apps vs one w/ two envs doesn't impact my cost, its a very reasonable workaround

kumada15 commented 2 years ago

We need this feature.

parkournick2 commented 2 years ago

+1 to this

richbnaks7 commented 2 years ago

+1 to this

Etep15 commented 1 year ago

Agreed. +1 to this.

codingloop commented 1 year ago

+1 to this

codingloop commented 1 year ago

Use case:

Have dev environment, say using the domain abc.dev the clients to set their own subdomain, so the clients will be using the URL's like below:

A REST call would be like this https://dan.abc.dev/api/some-url and it needs to be redirected to server (ex: https://my-dev-app.elasticbeanstalk.com)

Now, these redirections should be based on the environment. Ex:

Due to corporate firewall policies, if the REST calls are made directly to https://my-prod-app.elasticbeanstalk.com from next.js app - they are blocked by CORS policy

shemekhe commented 5 months ago

+1

jimlundblad commented 5 months ago

+1 similar but different use case to @codingloop where we need to redirect different env domains to specific DAM urls

justincbeck commented 1 month ago

+100 to this. This seems like a no-brainer.