Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README to reflect current local testing and building considerations #80

Merged
merged 3 commits into from
Feb 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ executables:
# ...
```

You'll need to either build on a compatible linux host or inside a compatible docker container (or some other mechanism like nix).
Note that current Stack LTS images are _not_ compatible.
If you see an error message that contains "version 'GLIBC_X.XX' not found" when running (hosted or locally), then your build environment is not compatible.

Enable stack's docker integration and define an optional image within stack.yaml:

```yaml
# file: stack.yaml
docker:
enabled: true
# If omitted, this defaults to fpco/stack-build:lts-${YOUR_LTS_VERSION}
image: ${BUILD_IMAGE}
```

Don't forget to define your [CloudFormation] stack:

```yaml
Expand Down Expand Up @@ -164,7 +178,6 @@ aws lambda invoke \

- [Stack][stack.yaml]
- [Docker]
- [aws-sam-cli] (>v0.8.0)

### Build

Expand All @@ -173,7 +186,18 @@ docker pull fpco/stack-build:lts-{version} # First build only, find the latest v
stack build --copy-bins
```

### Execute
### Execute w/ Docker

```bash
echo '{ "accountId": "byebye" }' | docker run -i --rm \
-e DOCKER_LAMBDA_USE_STDIN=1 \
-v ${PWD}/.stack-work/docker/_home/.local/bin/:/var/task \
lambci/lambda:provided
```

### Execute w/ SAM Local

Note that hal currently only supports [aws-sam-cli] on versions <1.0.

```bash
echo '{ "accountId": "byebye" }' | sam local invoke --region us-east-1
Expand Down