amplify-cli
amplify-cli copied to clipboard
Golang `mock` tcp :8900: connect: connection refused
How did you install the Amplify CLI?
yarn
If applicable, what version of Node.js are you using?
v18.19.0
Amplify CLI Version
12.10.2
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
N/A
Describe the bug
when running amplify mock function <functionID> --event src/event.json, got error
tcp :8900: connect: connection refused
Expected behavior
when running amplify mock function <functionID> --event src/event.json, lambda should work as expected.
Reproduction steps
- in a new folder,
yarn init -y -
amplify init -y -
amplify add function, choosego. - run
amplify mock function <functionID> --event src/event.json, see the error.
Project Identifier
No response
Log output
# Put your logs below this line
Additional information
No response
Before submitting, please confirm:
- [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.
mock doesn't work because our Go Runtime has already upgraded from go1.x (https://github.com/aws-amplify/amplify-cli/pull/13671), which means the RPC we use for mock doesn't work anymore.
ref:
- how we use RPC for the mock https://djharper.dev/post/2018/01/27/running-go-aws-lambda-functions-locally/