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

add a Terraform module to this codebase #56

Open
gpetras opened this issue Jul 25, 2023 · 1 comment
Open

add a Terraform module to this codebase #56

gpetras opened this issue Jul 25, 2023 · 1 comment

Comments

@gpetras
Copy link

gpetras commented Jul 25, 2023

Hi -

It would be super helpful if there were a Terraform module to deploy this S3 log ingestion Lambda, similar to how the New Relic CloudWatch log ingestion Lambda, here: https://github.com/newrelic/aws-log-ingestion.

Thanks!

@wesleyhaws
Copy link

I made my own terraform module for this and it wasn't too bad. The issue I had was with building. They're using a crazy old version for smart_open, it was so old it couldn't build a wheel file. So I updated it in the requirements.txt file and it built fine. I have been monitoring the logs and they seem to be healthy. So with all that said here is how you can do it.

  1. Update the requirements.txt line that says:
smart-open==2.1.0

To

smart-open==4.1.2
  1. Make a script file with:
#!/bin/bash

set -euo pipefail
trap "set +e" EXIT

# change working directory to this directory
pushd "$(dirname "$0")"
pip install --no-cache-dir --platform manylinux2014_x86_64 --only-binary=:all: --python-version $1 -r requirements.txt -t .
popd

Then you can use the null_resource to execute your script, archive_file to generate the zip, then include the zip into the source_code_hash field of the aws_lambda_function resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants