# layerd
Mount, Download, and Inspect Lambda Layers in seconds.
> Lambda Layers created by a third party?
>
> Want the contents locally?
>
> Use `layerd`.
# Table of Contents
0. [Inspiration](#inspiration)
1. [Installation](#installation)
2. [Usage](#usage)
3. [License](#license)
4. [Contributions](#contributions)
# Inspiration
### Firstly, What is a Lambda Layer?
A Lambda Layer is an archive containing [...] code.
When you include a layer in an [AWS Lambda] function,
the contents are extracted to [...] the execution environment.
As defined by [an AWS Compute blog.](https://aws.amazon.com/blogs/compute/using-lambda-layers-to-simplify-your-development-process/#:~:text=A%20Lambda%20layer%20is%20an,directory%20in%20the%20execution%20environment.)
### Ok, then what does this `layerd` library do?
Several steps of Layer inspection are automated here.
Currently, a Layer is deployed to AWS under 1) a Name and 2) a Version. Once a version is deployed (possibly by a Third-Party), how can you then see the contents of that layer?
One way would be to fumble around with the contents of the `/opt` directory in a lambda function. The equivalent to trying to lick your elbow.
Another way, only possible if created by a First-Party, would be to head to AWS, login, navigate to Lambda's page,
enter the Layer subsection, choose a version, and press Download. From there, head to your local system, and unzip the contents. Of course the preferred way,
but is greatly limited to solely First-Parties and takes several minutes of navigation and login to a 2FA system.
`layerd` automates the latter. `layerd` pings AWS Lambda, with the exact ARN of the Layer Version wanted, downloads, unzips, and mounts the contents locally. Within seconds.
Not a bad way to save a few minutes.
# Installation
$ pip3 install layerd
# Usage
#### CLI
The `layerd` script is automatically added to your OS's Path.
Call it with an ARN of a public lambda layer to mount the layer.
$ layerd <ARN>
Example:
$ layerd arn:aws:lambda:us-east-1:ACC:layer:LAYER-NAME:221
Layer: LAYER-NAME
Region: us-east-1
V: 221
Created: ./LAYER-NAME-221/
And pulled, unzipped, and mounted is the contents of the Lambda Layer.
$ tree
.
└── LAYER-NAME-221/
└── ...
#### Python Inline
The `layerd` module has a `layerd(arn: str)` function to mount a Lambda Layer.
>>> from layerd import layerd
>>> layerd('arn:aws:lambda:us-east-1:ACC:layer:LAYER-NAME:335')
Layer: LAYER-NAME
Region: us-east-1
V: 335
Created: ./LAYER-NAME-335/
Boom. You've mounted the Layer locally.
# License
`layerd` is licensed under the MIT License. See [LICENSE](LICENSE) for more.
# Contributions
Pull Requests for modifications are always welcome. Forks are preferred over Branches.
Want to become a maintainer? Submit 5 PRs, then we'll talk.
Raw data
{
"_id": null,
"home_page": "https://github.com/ronnathaniel/layerd",
"name": "layerd",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "python,python3,layerd,daemon,download,layer,extension,aws,lambda,function,remote",
"author": "ronnathaniel",
"author_email": "rnathaniel7@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b2/20/86ddbdce18eec04cbb61ef069fb5b47630479eafd81a38db691ef6f4f91d/layerd-2023.4.24.12.34.tar.gz",
"platform": null,
"description": "# layerd\n\nMount, Download, and Inspect Lambda Layers in seconds.\n\n> Lambda Layers created by a third party?\n>\n> Want the contents locally?\n>\n> Use `layerd`.\n\n\n# Table of Contents\n\n0. [Inspiration](#inspiration)\n1. [Installation](#installation)\n2. [Usage](#usage)\n3. [License](#license)\n4. [Contributions](#contributions)\n\n\n# Inspiration\n\n### Firstly, What is a Lambda Layer?\n\n A Lambda Layer is an archive containing [...] code.\n When you include a layer in an [AWS Lambda] function,\n the contents are extracted to [...] the execution environment.\n\nAs defined by [an AWS Compute blog.](https://aws.amazon.com/blogs/compute/using-lambda-layers-to-simplify-your-development-process/#:~:text=A%20Lambda%20layer%20is%20an,directory%20in%20the%20execution%20environment.)\n\n### Ok, then what does this `layerd` library do?\n\nSeveral steps of Layer inspection are automated here.\n\nCurrently, a Layer is deployed to AWS under 1) a Name and 2) a Version. Once a version is deployed (possibly by a Third-Party), how can you then see the contents of that layer?\n\nOne way would be to fumble around with the contents of the `/opt` directory in a lambda function. The equivalent to trying to lick your elbow.\n\nAnother way, only possible if created by a First-Party, would be to head to AWS, login, navigate to Lambda's page, \nenter the Layer subsection, choose a version, and press Download. From there, head to your local system, and unzip the contents. Of course the preferred way, \nbut is greatly limited to solely First-Parties and takes several minutes of navigation and login to a 2FA system.\n\n`layerd` automates the latter. `layerd` pings AWS Lambda, with the exact ARN of the Layer Version wanted, downloads, unzips, and mounts the contents locally. Within seconds. \n\nNot a bad way to save a few minutes.\n\n\n# Installation\n\n $ pip3 install layerd\n\n\n# Usage\n\n\n#### CLI\n\nThe `layerd` script is automatically added to your OS's Path.\nCall it with an ARN of a public lambda layer to mount the layer.\n\n $ layerd <ARN>\n\nExample:\n\n $ layerd arn:aws:lambda:us-east-1:ACC:layer:LAYER-NAME:221\n\n Layer: LAYER-NAME\n Region: us-east-1\n V: 221\n\n Created: ./LAYER-NAME-221/\n\nAnd pulled, unzipped, and mounted is the contents of the Lambda Layer.\n\n $ tree\n .\n \u2514\u2500\u2500 LAYER-NAME-221/\n \u2514\u2500\u2500 ...\n\n\n#### Python Inline\n\nThe `layerd` module has a `layerd(arn: str)` function to mount a Lambda Layer.\n\n\n >>> from layerd import layerd\n\n >>> layerd('arn:aws:lambda:us-east-1:ACC:layer:LAYER-NAME:335')\n Layer: LAYER-NAME\n Region: us-east-1\n V: 335\n\n Created: ./LAYER-NAME-335/\n\n\nBoom. You've mounted the Layer locally.\n\n# License\n\n`layerd` is licensed under the MIT License. See [LICENSE](LICENSE) for more.\n\n# Contributions\n\nPull Requests for modifications are always welcome. Forks are preferred over Branches.\n\nWant to become a maintainer? Submit 5 PRs, then we'll talk. \n",
"bugtrack_url": null,
"license": "",
"summary": "Download AWS Lambda Layers.",
"version": "2023.4.24.12.34",
"split_keywords": [
"python",
"python3",
"layerd",
"daemon",
"download",
"layer",
"extension",
"aws",
"lambda",
"function",
"remote"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b22086ddbdce18eec04cbb61ef069fb5b47630479eafd81a38db691ef6f4f91d",
"md5": "8472dd081c05abe0da4e2ed351e1d5eb",
"sha256": "4c3bd444d2b228920590d029121194a724dc59737f31b099ca9bee190404bb24"
},
"downloads": -1,
"filename": "layerd-2023.4.24.12.34.tar.gz",
"has_sig": false,
"md5_digest": "8472dd081c05abe0da4e2ed351e1d5eb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 5970,
"upload_time": "2023-04-24T16:34:51",
"upload_time_iso_8601": "2023-04-24T16:34:51.237396Z",
"url": "https://files.pythonhosted.org/packages/b2/20/86ddbdce18eec04cbb61ef069fb5b47630479eafd81a38db691ef6f4f91d/layerd-2023.4.24.12.34.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-24 16:34:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "ronnathaniel",
"github_project": "layerd",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "layerd"
}