aws-amplify / aws-amplify/amplify-cli

Feature Request: More Robust Multienv `push`

Open
#594 4 comments 5 reactions 0 assignees View on GitHub
feature-request multienv ops-multienv p4 platform
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

THE PROBLEM(s)
1. When using the multienv (beta) support, I've noticed that it is TOO easy to accidentally get into a situation where e.g. env `X` settings get pushed to env `Y` (if for example `amplify init` is skipped when changing branches).
2. As well, it is made worse by the fact that before confirming the `amplify push` actions, an Update operation could refer to either "patch existing resource" or "delete-and-recreate resource" (yikes!).
3. Finally, there isn't a general, ALL CAPS warning when any delete operation happens to existing `auth` resources.

IDEAL SOLUTION(s)
1. I think it is a fundamental limit of the approach of coupling the envs to a git branch. I don't have a ready solution for the current approach, but other tooling would be more like `amplify push --env production`. Maybe this could be an optional argument anyway, so the `amplify` command would validate the env matches what was requested and aborts otherwise?
2. Hopefully it is possible to differentiate an Update that is "patch" vs "recreate" and communicate that to the user, and/or print a complete list of the resources that will be changed (not just "auth" or "hosting"), and whether each resource existed already?
3. I think a basic, dumb warning (or extra confirmation prompt) would help prevent a future disaster, as well (if necessary) an argument like `--no-delete-warning` to allow automated use but still indicate to script authors what (may) happen.

Contributor guide

Open the contributing guide

Research direction

The issue names amplify init and amplify push as entry points; begin by tracing the multienv push flow and its confirmation output. Done would require an agreed design covering environment validation, patch-versus-recreate reporting, and auth deletion warnings, followed by tests for each behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, typescript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.