An AWS Lambda function in Go for archiving a list of data from URLs
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A Lambda function using the Go 1.x runtime that takes a list of URLs, archives the data from them in a zip file, and provides a download URL.

Local Development

Install and use AWS SAM Local for local testing. This will use the template.yml file as a definition of the function to test.

  1. Start the local API: sam local start-api
  2. Make changes to the code
  3. Build the code: GOOS=linux GOARCH=amd64 go build -o main main.go
  4. Use the included Postman collection for testing requests against the code

AWS Lambda

  1. Archive the built artifact: zip main
  2. Upload it to your Lambda function: aws lambda update-function-code --function-name archive --zip-file fileb://

Example Request

The request body takes a filename and array of URLs. The filename is used as the filename for anyone who downloads the archive file that is created from the files in the "urls" array.

curl -X POST \ \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{
	"filename": "randomImages",
	"urls": [