GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - gugzkumar/my-python-lambda-layers: This repo will help build AWS lambda layers on Python 3.7, that can be used for personal projects

BranchesTags
Open more actions menu

Latest commit

 

History

20 Commits
20 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
layer-python-core
layer-python-core
 
 
layer-python-crypto
layer-python-crypto
 
 
layer-python-math
layer-python-math
 
 
zipped-layers
zipped-layers
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.sh
build.sh
 
 
generate-layer-zip.sh
generate-layer-zip.sh
 
 

Repository files navigation

My Python Lambda Layers

This repo is meant to be the source of truth and code to build AWS lambda Layers for my personal projects. I would suggest if you are trying to build a AWS Lambda app, you build your own layers using this repo as a source of inspiration.

Layers in This Repo

python-core

requests==2.22.0
SQLAlchemy==1.3.12
beautifulsoup4==4.8.2
flashtext==2.7
slackclient==2.5.0

python-crypto

pyjwt==1.7.1
cryptography==2.8

python-math

numpy==1.18.0
pandas==0.25.3

Building or Updating a Layer

IMPORTANT: If you update a layer make sure to also update your Lambda function to us the new version.

Option 1: Manual Creation

  1. Run bash generate-layer-zip.sh.
  2. Confirm that in the zipped-layers folder of this project, you have zip files for each of your layers.
  3. Go to AWS create your layer by uploading the zip file, with python 3.7 as the lambda environment

Option 2: Create With Continuous Deployment Via Github Actions

  1. In the github repo create the following secrets: AWS_DEFAULT_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY.
  2. Next just add a commit to the master branch.
  3. Monitor the Publish_Layers workflow on the Actions tab of your repo. When this succeeds the layers should be created.
  4. Look in your AWS account to confirm that they are created

Adding new layers

  1. Add a new new folder to the root of the folder with the following folder structure. Fill requirements.txt with your versioned dependencies.
    .
    ├── ...
    ├── my-new-layer
    │   ├── python
    │   │   ├── lib
    │   │   │   ├── python3.7
    │   │   │   │   ├── site-packages
    │   │   │   │   │   ├── .gitkeep
    │   ├── requirements.txt
    │   └── ...
    └── ...
    -
    
  2. Add this line to build.sh
    ...
    build_a_layer "{LAYER_FOLDER_NAME}"
    
  3. Add these lines line to .github/workflows/publish_layers.yml. Properly replace LAYER_FOLDER_NAME and LAYER_FOLDER_NAME.
    ...
    - name: Publish {LAYER_FOLDER_NAME}
      run: aws lambda publish-layer-version --layer-name {LAYER_NAME} --zip-file fileb://zipped-layers/{LAYER_FOLDER_NAME}.zip
    

About

This repo will help build AWS lambda layers on Python 3.7, that can be used for personal projects

Topics

awsaws-lambdalayerspythonpython-lambda-layers

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.