View a markdown version of this page

Create a custom environment - AWS Amplify

Create a custom environment

Welcome to the new AWS Amplify

Amplify now puts hosting, a Postgres database, and sign-in in one AWS account. Deploy from your terminal or from Git, check every change in a preview first, and roll back in one step if something breaks.

Looking for Amplify Hosting? See the Amplify Hosting User Guide.

In addition to the production and preview environments, you can create your own pre-production environments. Custom environments let you add stages like staging or QA to your workflow.

To control for which Git branches that you want Amplify to release, configure the branch tracking.

The following are example branch tracking rules:

  • * - All branches

  • !main - All branches except main

  • feature/* - All branches that start with feature/. This could include feature/auth or feature/a

Create a custom environment in the console

  1. Sign into the Amplify console at https://us-east-2.console.aws.amazon.com/amplifygen3/home.

  2. Choose an app.

  3. In the left navigation pane, choose Settings.

  4. For Environments, choose Create environment.

  5. For Environment name, enter a name. The name must be 1–40 characters, use lowercase letters, and can’t be production or preview, which are reserved.

  6. For the environment’s role, choose a new or existing IAM role for the environment to use.

  7. (Optional) If your app is connected to GitHub or GitLab, for Branch tracking, do the following:

    1. Choose a condition for automatic deployments.

    2. Choose Add rule to create a new condition for automatic deployments.

  8. Choose Create.

Create a custom environment using the CLI

The following CLI command creates a custom environment.

aws amplifygen3 env create --name staging