amplify-cli
amplify-cli copied to clipboard
Amplify-cli@env renaming an environment
Is your feature request related to a problem? Please describe.
Is it possible to rename an environment from, say "maaster" to "master"? The issue I'm currently facing is that I did not rename the environment when I switched to amplify-cli@env (so my only environment is called: "NONE"). I would like to rename this NONE environment to dev while preserving existing backend resources.
Describe the solution you'd like
amplify env rename dev
> Enter new name: (dev)
Describe alternatives you've considered Creating a new branch, although I have some data, currently, that I'd rather not lose.
Additional context amplify-ci@env --version: 0.2.1-multienv.22
@ajhool We currently don't support modifying the environment name since we use that directly for resource naming. And NONE has a special meaning (for projects initialized using an older version of the CLI without multienvironment support). You can fork off stages of this environment though using the amplify init command.
That being said, we're looking into adding more flexibility and modifications to the env name.
Thank you, I'm happy to close this issue if it's not particularly useful to keep up! (should I?)
@ajhool Let's keep this open since this is a useful feature request (although it won't be immediately prioritized).
I believe it will be great if we doc down this knowledge:
And NONE has a special meaning (for projects initialized using an older version of the CLI without multienvironment support).
Are you saying we should use "NONE" as if it was "prod" i.e. the master branch and just add new env's for "test" and "dev"?
@AndrewStaggPlunk If you were running amplify in production before multi-env was introduced, then yes I think that NONE would be your prod. Part of why I made this issue was because I think that will be a common frustration for people switching to multienv, especially if they were using amplify in production. I was lucky that I hadn't been using amplify in production and could throw away my NONE branch.
Just FYI, using all caps for NONE as opposed to lowercase "none" means that deploying that env in the Amplify console doesn't work -- they want all lowercase. So having the default in uppercase means that you can't move over existing production from an old version the CLI very smoothly.
@kaustavghosh06 Hey is there any update on if/when this might be prioritised? I very foolishly named the env we now use in production as test and it would be great to either rename this or somehow switch the branch we use for production to be a new branch which has the correct name
@kaustavghosh06 Are there any new updates on regarding this feature since @camin-mccluskey's last comment? I have naming inconsistencies between my environments and git branches and I'd prefer just renaming my environments to match my git branch names. I could just rename my git branches, but it'd be nice to know if an environment rename feature is being worked on or not.
+1 on this please. I have a bunch of random environment names due to setting up the branch pattern naming with a '/' character and Amplify deciding to generate random (sometimes ridiculous) names for the environment, as described in this issue - https://github.com/aws-amplify/amplify-console/issues/1801.
I appreciate this is probably quite a large undertaking but I would prefer to not have to tear-down environments just to change the name!
Thanks
+1
+1 for this
+1
+1
+1
+1
+1
+1
+1
+1
+1
+2!
+3
+4
+5
+999