Amplify-cli: Amplify-cli@env renaming an environment

Created on 10 Jan 2019  路  9Comments  路  Source: aws-amplify/amplify-cli

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

feature-request multienv

Most helpful comment

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

All 9 comments

@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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amlcodes picture amlcodes  路  3Comments

nicksmithr picture nicksmithr  路  3Comments

MageMasher picture MageMasher  路  3Comments

mwarger picture mwarger  路  3Comments

jexh picture jexh  路  3Comments