aws-amplify / aws-amplify/amplify-cli

add ability to pull env from cloud with `amplify pull --envName <env-name>` without also specifying App ID

Open
#9,457 0 comments 1 reaction 0 assignees View on GitHub
feature-request ops-multienv p4 platform-pull
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Is this feature request related to a new or existing Amplify category?

_No response_

### Is this related to another service?

_No response_

### Describe the feature you'd like to request

Add the ability to pull other Amplify backend environments from the cloud without also specifying the Amplify App ID.

- in projects where we've chosen NOT to modify the backend, we are able to pull the new environment from the cloud with:
```shell
amplify pull --appId --envName main
# ...
amplify pull --envName next
```
- in projects where we've chosen to modify the backend, we are unable to pull the new environment from the cloud without also specifying the App ID `amplify pull --appId --envName `

### When choosing to modify the backend

```console
> amplify pull --appId --envName main
? Select the authentication method you want to use: AWS profile

For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

? Please choose the profile you want to use default
Amplify AppID found: . Amplify App name is: myamplifyapp
Backend environment main found in Amplify Console app: myamplifyapp
? Choose your default editor: Visual Studio Code
? Choose the type of app that you're building javascript
Please tell us about your project
? What javascript framework are you using none
? Source Directory Path: src
? Distribution Directory Path: dist
? Build Command: npm run-script build
? Start Command: npm run-script start
? Do you plan on modifying this backend? Yes
✔ Successfully pulled backend environment main from the cloud.

Successfully pulled backend environment main from the cloud.
Run 'amplify pull' to sync future upstream changes.

> amplify pull --envName next
? Select the authentication method you want to use: AWS profile

For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

? Please choose the profile you want to use default
? Which app are you working on? (Use arrow keys)
❯ myamplifyapp ()
myotheramplifyapp ()
(Move up and down to reveal more choices)
```

### When choosing NOT to modify backend

```console
> amplify pull --appId --envName main
? Select the authentication method you want to use: AWS profile

For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

? Please choose the profile you want to use default
Amplify AppID found: . Amplify App name is: myamplifyapp
Backend environment main found in Amplify Console app: myamplifyapp
? Choose your default editor: Visual Studio Code
? Choose the type of app that you're building javascript
Please tell us about your project
? What javascript framework are you using none
? Source Directory Path: src
? Distribution Directory Path: dist
? Build Command: npm run-script build
? Start Command: npm run-script start
? Do you plan on modifying this backend? No

Added backend environment config object to your project.
Run 'amplify pull' to sync future upstream changes.

> amplify pull --envName next
Amplify AppID found: . Amplify App name is: myamplifyapp
Backend environment next found in Amplify Console app: myamplifyapp

Added backend environment config object to your project.
Run 'amplify pull' to sync future upstream changes.
```

### Describe the solution you'd like

Pull new environments from cloud with `amplify pull --envName next` after initially pulling the project without also specifying the App ID of the already pulled project

### Describe alternatives you've considered

n/a

### Additional context

_No response_

### Is this something that you'd be interested in working on?

- [ ] 👋 I may be able to implement this feature request
- [ ] ⚠️ This feature might incur a breaking change

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.