https://github.com/jason-dour/hugo-aws-lambda-layer
AWS Lambda Layer for Hugo from gohugo.io.
https://github.com/jason-dour/hugo-aws-lambda-layer
aws aws-lambda aws-lambda-layer aws-lambda-layers cloud hugo lambda lambda-layer lambda-layers serverless
Last synced: about 1 month ago
JSON representation
AWS Lambda Layer for Hugo from gohugo.io.
- Host: GitHub
- URL: https://github.com/jason-dour/hugo-aws-lambda-layer
- Owner: jason-dour
- License: apache-2.0
- Created: 2020-01-20T01:18:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-14T23:53:02.000Z (over 3 years ago)
- Last Synced: 2024-11-02T06:32:59.550Z (6 months ago)
- Topics: aws, aws-lambda, aws-lambda-layer, aws-lambda-layers, cloud, hugo, lambda, lambda-layer, lambda-layers, serverless
- Language: Shell
- Homepage:
- Size: 8.79 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-layers - `jason-dour/hugo-aws-lambda-layer`
README
# hugo-aws-lambda-layer
AWS Lambda Layer for Hugo from gohugo.io.
It is intended to be functional in all runtimes. It has been tested in `go1.x` and `python3.8` so far.
## Building the Layer
1. Make certain you have the `lambci/lambda:build-go1.x` Docker image needed to build the layer.
``` shell
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
lambci/lambda build-go1.x 051f7de811cf 11 days ago 2.2GB
```1. If you do not have the images, just pull them with a `docker pull` command.
1. Confirm the build directory is clean.
``` shell
$ ls -1
LICENSE
README.md
build.sh
```1. ~~Then execute the docker `lambci/lambda:build-go1.x` image to run the build script.~~
~~`docker run --rm -it -v `pwd`:/tmp/repo --entrypoint /bin/bash lambci/lambda:build-go1.x /tmp/repo/build.sh`~~
Using the `golang:1.17.1-alpine3.14` image, run the build script (can't use `lamci/lambda` anymore due to golang version requirement):
``` shell
docker run --rm -it -v `pwd`:tmp/repo --entrypoint /bin/bash golang:1.17.1-alpine3.14 /tmp/repo/build.sh
```## Deploy the Layer
Once the layer zip file is created, you can deploy it to your AWS account with the following command:
``` shell
aws lambda publish-layer-version --layer-name "hugo-VERSION" --description "Hugo VERSION for All Runtimes" --license-info "Apache 2.0" --zip-file "fileb://hugo.zip"
```