Documentation
¶
Overview ¶
Command backyard-lambda runs the Backyard deploy gateway (SPEC §7) as an AWS Lambda function behind a function URL (or an API Gateway HTTP API).
Configuration is read like the server's (BACKYARD_CONFIG_YAML holds the YAML inline, or BACKYARD_CONFIG names a file bundled with the function). server.secret comes from the configuration or BACKYARD_SECRET, or, when BACKYARD_SECRET_ARN names an AWS Secrets Manager secret, from that secret at cold start (see secret.go; setting both is an error). Storage is normally S3, so uploads go straight to presigned S3 URLs and the 6 MB Lambda payload limit only applies to gateway responses: large JSON responses (the upload list of a deploy of thousands of files) are gzipped for clients that accept it, and a response that still does not fit (e.g. reading back a large binary file) is a 413 pointing to the server's embedded gateway (see deploy.LambdaHandler). BACKYARD_GATEWAY_URL (or deploy.gateway_url) sets the URL advertised to CLIs; when unset it is derived from each request's host.
Build:
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -tags lambda.norpc -o bootstrap ./cmd/backyard-lambda