top of page
  • Writer's picturekhyati sehgal

Setting environment variables in AWS amplify

Use case

  1. There are certain variables which we need to set while building our application like Integration of test Runner services like Sauce Labs, Browserstack, etcFor this you need to fetch the user name & key from the build tool itself.

  2. Also , there could be a chance where you need to run automation at one environment & don’t need to run the whole regression suite on it.

And many more.. As we set them for any Operating system like Windows, Mac, its always good to have them in delivery process as well. Just to make sure we are keeping things flexible

In such cases, you need to set environmental variables.

Steps to set the environment variables in AWS Amplify

  1. Click on the Environment Variables under App Settings. You can get this option in left panel of your build set up.

You will get a screen where in you can create env_variables.

Depending on the requirement you need to mention which branch it will target for this

Select none if you don’t want at all any action to happen against this variable.

Click on ‘manage variable‘, to create a new variable

Click on ‘add variable‘ to add a new variable, and provide a name.

This variable would be global so will be available to all the branches. For example TEST_CONFIG the one I added is for all branches by default.

On which ever environment you need to retrieve its value, you can provide the name of the branch like this:-

Click on ‘Actions

And select ‘Add variable‘, & against this choose the respective branch, for all others you can mention none.

8 views0 comments

Recent Posts

See All
bottom of page