aws-amplify / aws-amplify/amplify-cli

Check Resource Permissions for Lambda Layers on - amplify push

Open
#10,607 1 comment 0 reactions 0 assignees View on GitHub
feature-request functions p4
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?

function

### Is this related to another service?

Lambda Layer

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

I have a Lambda layer which accesses DynamoDB.
For this to be possible, it needs the permissions in the respective parent lambda, since you can't give any to the layer itself.

Now I have assigned this layer to several Lambda functions. But I forgot to give the permissions to an old lambda. I noticed this only very late that the Lambda no longer runs because the TableName was not known.

### Describe the solution you'd like

It would be nice to read the code of the layer and see which TableNames are used to give a message if a layer is on a Lambda, but this does not have the permissions.

### Describe alternatives you've considered

Maybe there are better ideas than reading the code.

### Additional context

_No response_

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

- [ ] 👋 I may be able to implement this feature request

### Would this feature include a breaking change?

- [ ] ⚠️ This feature might incur a breaking change

Contributor guide

Open the contributing guide

Research direction

Start at the amplify push flow and trace how Lambda layers are attached to functions and how DynamoDB permissions are represented for parent Lambdas. Determine how the CLI could detect a layer's resource use without relying on the proposed code-reading approach. Done means amplify push reports missing permissions for every affected function, including an old Lambda using the layer.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cli, cloud, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.