Open joekiller opened 2 years ago
Hey @joekiller, thank you for reaching out. I tried replicating the lambda function in my Amplify application but was unable to reproduce the issue.
Steps utilized:
Could you let us know what runtime was utilized when the lambda function was created?
By runtime do you mean what lambda runtime? It was a nodejs function. When I encountered this is was somewhat of a revert. So maybe that part is what is missing? Ie maybe try:
if you cannot replicate after that I guess we can just close this.
Hey @joekiller, Thank you for the information. On further testing I observed that amplify CLI shows the status as no change when we modify the custom-policies.json
when a push is currently occurring.
Reproduction steps:
amplify add function
select NodeJs runtime.amplify push
custom-polices.json
amplify status
(this should show as no change)Thank you for reporting. marking this as bug for further investigation.
Note for fix: this is likely due to this file not being tracked as a part of the collection used to determine resource state
The workaround to this issue would be to make a small update to the source code (e.g. add a newline to src/index.js
) or use --force
with amplify push
@josefaidt thanks for noting a workaround. I'll keep it in mind if I find myself in the situation again.
@josefaidt the workaround is not working for me. I can see that a new function created in the CLI is not creating a CustomLambdaExecutionPolicy
entry in the function's generated cloudformation-template.json
.
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v16.16.0
Amplify CLI Version
9.2.1
What operating system are you using?
Arch Linux
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Amplify Categories
function
Amplify Commands
push
Describe the bug
I updated the custom-policies.json and amplify push didn't register the change.
Expected behavior
I expected the custom policy to be applied to the cloudformation.
Reproduction steps
GraphQL schema(s)
Project Identifier
No response
Log output
Additional information
No response