Giter Club home page Giter Club logo

aws-cdk-action-for-python-project's Introduction

GitHub Action for AWS CDK

This Action for AWS CDK allow you to build your python layer in an amazon linux 2 docker image (so you will get native libs optimized for your lambda runtime environment), and allow you to run the cdk command you needs (cdk synth, npx cdk deploy, ...) after you build your python layer.

Currently supports CDK apps using Typescript cdk, and python projects

*This Github Action is specifically based on the Amazon Linux distribution to ensure Python dependencies, compiled to C, are functional when deployed to AWS Lambda.

Usage

An example workflow for building a layer zip archive, and synthesizing an AWS CloudFormation template for your app using cdk synth.

name: AWS CDK Synth

on: [push]

jobs:
  aws-cdk-synth:

    runs-on: ubuntu-latest

    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: CDK Synth
      uses: muldos/github-action-aws-cdk-amazon-linux@master
      with:
        python_build_command: 'pip3 install -r requirements.txt -t dist/layer/python/lib/python3.8/site-packages'
        zip_layer_command: 'zip -r dist/layer/third-parties-layer.zip dist/layer/python'
        cdk_command: 'npx cdk synth'
        cdk_work_dir: 'deploy'
      env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        AWS-DEFAULT_REGION: 'eu-west-1'

Secrets

  • AWS_ACCESS_KEY_ID โ€“ Required The AWS access key part of your credentials (more info)
  • AWS_SECRET_ACCESS_KEY โ€“ Required The AWS secret access key part of your credentials (more info)

For details on creating secrets and using them with GitHub Actions, see Creating encrypted secrets for a repository.

License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License.

Container images built with this project include third party materials. See THIRD_PARTY_NOTICE.md for details.

Credits

Many thanks to Scott Brenner and Greg Farrow for their original Github Action(s) which this action is based on.

aws-cdk-action-for-python-project's People

Contributors

muldos avatar g-farrow 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.