What's the difference between amplify env checkout and import?

Viewed 361

The documentation describes two commands:

amplify env checkout <env-name> [--restore]
amplify env import --name <env-name> --config <provider-configs> [--awsInfo <aws-configs>]

But doesn't explain the difference between them in detail. checkout seems pretty straightforward with examples that make it analogous to git checkout, but import is a bit of a mystery. What are the various use cases?

1 Answers

amplify env checkout ... is to switch between existing in your local backend environment stacks.

amplify env import ... is to imports an already existing Amplify project environment stack to your local backend.

The more details how to use the commands can be found here.

Although the checkout command is very similar to git. The import command is a little bit confusing when you first try to use it. In the link above there is an example how to import the environment. The important thing is to get the right AWSCLOUDFORMATIONCONFIG from file amplify/team-provider-info.json

Personally for me is easier to keep every local backend stack in different directory.

Related