VV75
VV75

Reputation: 357

How to create multiple environments using AWS amplify

my app uses vue3, vuetify and amplify with rest api, dynamodb. Things were working as expected until I started getting errors in API calls that I couldn't explain. I deleted the "dev" enviornment using AWS console. When I tried to recreate the env using "amplify push", I got error saying "The specified bucket does not exist". So, I created a new env called "test" using "amplify init". Now "amplify push" is successful but the vue app seems to be pointing to older "dev" config.

I have two questions.

First, any thoughts on why I got "bucket doesn't exist" error.

Second, how do I get the vue app to use the new config that matches "test" env

Upvotes: 7

Views: 10505

Answers (1)

Arturo
Arturo

Reputation: 4180

It's actually very simple:

Goal: Have 1 environment for production and 1 environment for us to develop.

  • Create a new environment by doing: amplify env add, when prompted with "Select the authentication method you want to use", use "Amplify Admin UI". Give this env the name "prod"
  • Delete previous environment (ONLY IF YOU NEED TO DELETE IT) with name "staging, by typing amplify console and selecting "amplify console":
  • Create a new environment by doing: amplify env add and give this env the name "dev"

When ever you create a new environment, you switch to it automatically. You can check your current env, by doing Amplify status

Source and more info about managing the environment: Here

Upvotes: 12

Related Questions