Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create multiple environments using AWS amplify

Tags:

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

like image 966
VV75 Avatar asked Jul 22 '26 00:07

VV75


1 Answers

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

like image 148
Arturo Avatar answered Jul 26 '26 16:07

Arturo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!