GithubHelp home page GithubHelp logo

action-build-aws-lambda-extension's Introduction

"Build AWS Lambda Extension" GitHub Action

This GitHub action will create a ZIP file containing:

Prerequesites

Befor you can use this action to bundle Lambda Layer and the Sentry Lambda extension together you need to prepare your Lambda Layer in a directory called /dist-serverless:

A very basic example would be:

steps:
  - run: |
      echo "Create the Lambda in the dist-serverless directory"
      mkdir dist-serverless
      cp -r stuff/* dist-serverless/

You also have to make sure to include this directory in the build cache you need to set up using the actions/cache@v3 Github action.

How this is done you can learn in the build workflow of the Javascript SDK:

https://github.com/getsentry/sentry-javascript/blob/master/.github/workflows/build.yml

Usage

To bundle the above prepared Lambda layer with the latest Sentry Lambda Extension and save it in a file called sentry-python-serverless.zip you can the following to your GitHub workflow:

(The .zip file will be uploaded in the GitHub action so it can be used by other actions or steps in your workflow.)

steps:
    - uses: getsentry/action-build-aws-lambda-extension@v1
    with:
        artifact_name: ${{ github.sha }}
        zip_file_name: sentry-python-serverless.zip

This test script illustrates the usage of the action:

.github/workflows/test_production.yml

For an full example usage see the Sentry Python SDK:

https://github.com/getsentry/sentry-python/blob/master/.github/workflows/ci.yml

Inputs

The following are all required.

name description
artifact_name Name of the prepared articact the Lambda Layer zip file should be uploaded to
zip_file_name Name of the zip file that will be created
build_cache_key Build cache key
build_cache_paths Paths of the build cache
debug_enabled If set to "true" debugging is enabled and you can log into the running action. (See https://github.com/marketplace/actions/debugging-with-tmate)

Testing

If you want to see an example of a zip file this action can create looks like you can manually run the GitHub action "Test Production". This will create a dummy lambda layer (just containing one placeholder file) and the latest relay based Sentry Lambda Extension. After the GitHub action has run, you can download the generated artifact at the bottom of the summary page of the GitHub action result.

Contributing

See the Contributing Guide.

License

See the License File.

action-build-aws-lambda-extension's People

Contributors

antonpirker avatar sl0thentr0py avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.