amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

Amplify-cli@env renaming an environment

Open ajhool opened this issue 6 years ago • 29 comments
trafficstars

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 avatar Jan 10 '19 00:01 ajhool

@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.

kaustavghosh06 avatar Jan 10 '19 20:01 kaustavghosh06

That being said, we're looking into adding more flexibility and modifications to the env name.

kaustavghosh06 avatar Jan 10 '19 20:01 kaustavghosh06

Thank you, I'm happy to close this issue if it's not particularly useful to keep up! (should I?)

ajhool avatar Jan 10 '19 20:01 ajhool

@ajhool Let's keep this open since this is a useful feature request (although it won't be immediately prioritized).

kaustavghosh06 avatar Jan 10 '19 20:01 kaustavghosh06

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).

t0t07 avatar Feb 18 '19 23:02 t0t07

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 avatar Feb 28 '19 13:02 AndrewStaggPlunk

@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.

ajhool avatar Mar 02 '19 03:03 ajhool

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.

wildcat63 avatar May 03 '19 19:05 wildcat63

@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

camin-mccluskey avatar Feb 04 '20 01:02 camin-mccluskey

@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.

renellc avatar Sep 06 '21 20:09 renellc

+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

samputer avatar Oct 20 '21 13:10 samputer

+1

jsmith213561 avatar Jan 25 '22 00:01 jsmith213561

+1 for this

vinodvarma24 avatar Mar 18 '22 01:03 vinodvarma24

+1

Tiny999 avatar Jul 14 '22 20:07 Tiny999

+1

leandrorp avatar Oct 23 '22 14:10 leandrorp

+1

mint673 avatar Oct 31 '22 04:10 mint673

+1

anthodb avatar Dec 05 '22 13:12 anthodb

+1

evan-morgan avatar Feb 19 '23 01:02 evan-morgan

+1

fadedlamp42 avatar Mar 01 '23 20:03 fadedlamp42

+1

vbakavets avatar Apr 28 '23 18:04 vbakavets

+1

dave-meyer avatar May 01 '23 14:05 dave-meyer

+1

razorwu1994 avatar Jul 25 '23 01:07 razorwu1994

+2!

whunter avatar Sep 08 '23 14:09 whunter

+3

ruinixu avatar Sep 08 '23 17:09 ruinixu

+4

agerard57 avatar Oct 26 '23 13:10 agerard57

+5

lukasulbing avatar Mar 07 '24 11:03 lukasulbing

+999

LoOW3 avatar Apr 05 '24 14:04 LoOW3