aws-amplify / aws-amplify/amplify-cli

function additonal permissions displays removed resources as selection

Open
#11,167 1 comment 0 reactions 0 assignees View on GitHub
bug functions good first issue p2
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/dev/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### How did you install the Amplify CLI?

npm

### If applicable, what version of Node.js are you using?

_No response_

### Amplify CLI Version

10.0.0

### What operating system are you using?

Windows

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

no

### Amplify Categories

function

### Amplify Commands

update

### Describe the bug

When running amplify update function to select resource access permission the prompt displays resources that are removed as well.
![image](https://user-images.githubusercontent.com/87995712/195406250-ea19ec28-fdf6-4367-9ce2-71d2245d208d.png)
![image](https://user-images.githubusercontent.com/87995712/195406306-0460389f-7a71-45c6-b68f-a83003268efd.png)

### Expected behavior

show only existing resources

### Reproduction steps

1. amplify init
2. amplify add api or analytics or hosting or custom
3. amplify add function (base function no resource selected)
4. amplify push
5. `amplify remove `
6. amplify push
7. amplify update function
select `Resource access permissions`
observe the prompt

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Project Identifier

_No response_

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with amplify init, a resource, a function, resource removal, and amplify update function. Start at the Resource access permissions prompt in the update function flow and trace how selectable resources are gathered. Done means the prompt lists only resources that still exist after removal.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.