Skip to content

Commit 8ec2290

Browse files
Merge pull request #27 from SumoLogic/doc_update
Updated doc on Releasing AWS Lambda Layer Version
2 parents 47e1f5f + 0c1241c commit 8ec2290

6 files changed

Lines changed: 33 additions & 13 deletions

File tree

CONTRIBUTING.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,30 @@ First of all, thanks for contributing!. Before contributing please read the [COD
3636
Add the layer arn generated from build command output to your lambda function by following instructions in [docs](https://help.sumologic.com/03Send-Data/Collect-from-Other-Data-Sources/Collect_AWS_Lambda_Logs_using_an_Extension).Test by running the function manually. Confirm that logs are coming to Sumo Logic.
3737

3838
## Releasing the layers
39-
1. Change the *AWS_PROFILE* environment variable using below command. The profile should point to sumocontent aws account.
40-
`export AWS_PROFILE=<sumo content profile>`
41-
1. Update the layer version in *config/version.go*.
42-
1. Go to scripts folder
43-
`cd scripts/`
44-
1. Change the layer_name variable in zip.sh to avoid replacing the prod.
45-
1. Run below command
46-
`sh zip.sh`
39+
40+
### Notes on AWS Lambda Layer Versions
41+
- Lambda **layer versions are immutable**.
42+
- Once a version (e.g., `v10`) is published, its code and content cannot be modified.
43+
- If changes are needed, you must publish a **new version** (e.g., `v11`).
44+
45+
- Once you **delete a Lambda layer version** (like `v10`), it’s permanently gone.
46+
- You cannot reuse or re-publish that same version number.
47+
- Any new Lambda function or update trying to reference `v10` will fail.
48+
49+
- Existing Lambda functions that were already using `v10` may still run for a while,
50+
because AWS caches the layer code internally.
51+
- However, once you update or redeploy them, `v10` will no longer be available.
52+
53+
1. Change the *AWS_PROFILE* environment variable using below command. The profile should point to sumocontent aws account.
54+
`export AWS_PROFILE=<sumo content profile>`
55+
1. Update the layer version in *config/version.go*.
56+
1. Go to scripts folder
57+
`cd scripts/`
58+
1. Change the layer_name variable in zip.sh to avoid replacing the prod.
59+
1. Run the following command to publish the layer:
60+
`sh zip.sh`
61+
1. Run the following command to verify that the layer version is published across regions:
62+
`sh verify_layer_versions.sh`
4763

4864
### Github Release
4965

containerimageexample/python-arm64/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@ WORKDIR ${FUNCTION_DIR}
3939
COPY --from=build-image ${FUNCTION_DIR} ./
4040
# (Optional) Add Lambda Runtime Interface Emulator and use a script in the ENTRYPOINT for simpler local runs
4141
ADD https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie /usr/bin/aws-lambda-rie
42-
# Create the directory explicitly
42+
# Create the target directory for extensions
4343
RUN mkdir -p /opt/extensions
44-
# SumoLogic Lambda extension
45-
COPY extensions/sumologic-extension /opt/extensions/
44+
45+
# Extract the Sumo Logic Lambda extension package
46+
ADD sumologic-extension-arm64.tar.gz /opt/extensions/
47+
48+
# Clean up any hidden files from the extracted content
49+
RUN find /opt/extensions -type f -name ".*" -delete
4650
COPY entry.sh /
4751
RUN chmod 755 /usr/bin/aws-lambda-rie /entry.sh
4852
ENTRYPOINT [ "/entry.sh" ]
-13.5 MB
Binary file not shown.
-52 Bytes
Binary file not shown.
-130 Bytes
Binary file not shown.

scripts/zip.sh

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ for arch in "${ARCHITECTURES[@]}"; do
4040

4141
echo "Creating the Zip file binary in extension folder."
4242
cd "${TARGET_DIR}/${arch}"
43-
zip -r "zip/${binary_name}.zip" extensions/
44-
tar -czvf "zip/${binary_name}-${arch}.tar.gz" extensions/
43+
zip -j "zip/${binary_name}.zip" "extensions/${binary_name}"
44+
tar -czvf "zip/${binary_name}-${arch}.tar.gz" -C extensions "${binary_name}"
4545
status=$?
4646
if [ $status -ne 0 ]; then
4747
echo "Zip Generation Failed"

0 commit comments

Comments
 (0)