Policy analyzer should also include chalicelib
- Dominant language
- Python
- Stars
- 11.1k
- Forks
- 1k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
I am using Chalice **1.1.0**
Previously my Lambda function had this declaration:
```python
polly = boto3.client('polly')
```
The policy analyzer correctly picks it up and proceeds to generate the appropriate Polly policy for the Lambda function. However, later I was trying to move some Polly logic from the function into a custom `chalicelib/` module. When running `chalice deploy` again, the analyzer sees that the Polly client declaration is not in the Lambda function anymore and prompts the following message:
```
The following action will be removed from the execution policy:
polly:SynthesizeSpeech
Would you like to continue? [Y/n]:
```
I believe this is an undesired behavior, since the policy is _still_ required for the function even when the logic has been moved to `chalicelib/`.
### EDIT
Additionally, I just noticed that the analyzer also does not recognize the Polly client declaration if I undo everything above and add the client declaration in the Lambda function again, after `chalice deploy`.
Contributor guide
Research direction
Start by reproducing the issue with `chalice deploy` using a Polly client in the Lambda function, then move the logic into `chalicelib/` and observe the policy analyzer output. Trace how the policy analyzer discovers boto3 client declarations and verify that the Polly action remains in the execution policy in both arrangements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100