Manage aws layers
Project description
Python-layer
The python-layer is a script inspired from python-lambda that can help managing aws layers. There are 5 available commands with options.
Requirements
- Python 3
- GNU Linux
Installation
You can create a new virtual environment on your computer and then install python-layer via pypi.
pip install python-layer
Getting Started
The script searches in a directory for the requirements.txt
file and creates a zip with all the dependencies. If there are .py
files, they are included in the zip.
To create a new layer:
layer build path/to/mydir
Here we suppose that mydir
has at least the requirements file.
To deploy the layer to aws:
layer deploy path/to/zip -d myshortdescription --runtime python3.7
To deploy the layer to aws to a specific region
layer deploy path/to/zip -r region_name
To deploy the layer to aws to a specific region and to a specific profile (e.g. dev profile)
layer deploy path/to/zip -p dev_profile -r region_name
To list the available layers:
layer list
To list the available layers from a specific region:
layer list -r region_name
To list the available layers from a specific region and from a specific profile (e.g. dev profile):
layer list -r region_name -p dev_profile
To set a layer to a lambda function (appends the latest version of the layer):
layer set mylayer mylambda
To set a layer to a lambda function (appends the latest version of the layer) to a specific region:
layer set mylayer mylambda -r region_name
To set a layer to a lambda function (appends the latest version of the layer) to a specific region and to a specific profile:
layer set mylayer mylambda -p dev_profile -r region_name
To set a list of layers:
layer set mylayer1,mylayer2 mylambda
To set a list of layers replacing the older ones :
layer set mylayer1,mylayer2 mylambda -d
To download a layer
layer download mylayer
To download a layer from a specific region:
layer download mylayer -v version_number -r region_name
To download a layer from a specific region and from a specific profile (e.g. dev profile):
layer download mylayer -v version_number -r region_name -p dev_profile
Notes
- Currently the script uses the credentials from the
~/.aws/config
file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python-layer-1.2.2.tar.gz
.
File metadata
- Download URL: python-layer-1.2.2.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eb5e5ffd61d99e36430bcab08b0cade52b7e4409fb83d0fdd68b3e882039948 |
|
MD5 | fb8ac3b7fd1c504ff677c60eb6821fe2 |
|
BLAKE2b-256 | 9252741cde74b817ae8cfffddaeb613d7a9a23d16e587234b734314e6e6b8f47 |
File details
Details for the file python_layer-1.2.2-py3-none-any.whl
.
File metadata
- Download URL: python_layer-1.2.2-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea6681d76fb98e6b3c415df6800d57246ae0d3fefd07ba9c83967eacf59284d1 |
|
MD5 | a2306fdb25d380bf5b2b3ca8d517305c |
|
BLAKE2b-256 | 901822268a7c9c4c17d27a99db5150482b6866653562bc8776c49d04cb9a4a54 |