aws-amplify / aws-amplify/amplify-cli

Go lambda function adding external files to bin folder

Open
#4,501 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

**Describe the bug**
I am trying to move my lambda functions from my serverless project to amplify, and I have a function that has external fonts and executes headless chrome from binaries.

If I try to add the external files to bin folder and push function to the cloud, then amplify go function runtime provider empties the bin folder before compiling main binary, so the pushed lambda function doesn't have anything besides the go main binary.

**Amplify CLI Version**
4.21.1

**Additional context**

```
// Clean and/or create the output directory
if (fs.existsSync(outDir)) {
fs.emptyDirSync(outDir);
} else {
fs.mkdirSync(outDir);
}

```
Code above in the `amplify-cli/packages/amplify-go-function-runtime-provider/src/runtime.ts` empties the bin folder.

**Expected behavior**

Could `amplify-cli/packages/amplify-go-function-runtime-provider/src/runtime.ts` be changed to just remove the go main binary when bin directory exists? Then external files could be easily added to the bin folder.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.