Comments (10)
Is it just a package.json that's required, or does it need to be published to npm?
from git-lambda-layer.
The package.json allows me to include it as a dependency straight from github (see below).
{
"name": "aws-git-client-nodejs",
"version": "1.0.0",
"description": "CodeCommit example using git client",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"async": "^2.6.1",
"simple-git": "^1.95.0"
},
"devDependencies": {
"git-lambda-layer": "lambci/git-lambda-layer",
"serverless": "^1.35.0"
},
"author": "Marcelo Bernardes (https://github.com/marcelobern)",
"license": "MIT"
}
Publishing on npm would allow users to specify which version they want to have as a dependency, so it is probably better.
As I thought about this, we probably will need a boiler plate index.js (something just with console.info()
with a message to indicate this module should be run as a lambda layer).
from git-lambda-layer.
@mhart Happy New Year!!!
Wanted to follow up and check if you want me to create a PR for this.
I am hoping to wrap up the serverless PR changes by this weekend as lambda-git
is now deprecated in favor of this project.
from git-lambda-layer.
Hi @mhart I figured you have been tied up elsewhere so I went ahead and:
- Ppened PR #6.
- Added this as a npm package.
I will be more than happy to transfer the npm package ownership if you can provide me a npm username for the new owner.
from git-lambda-layer.
Just thinking about this some more – why do you want this as a devDependency in your package.json? That feels like a bug – devDependencies are supposed to be Node.js modules, and this isn't one.
from git-lambda-layer.
Here's the documentation on layers in the serverless framework, and it doesn't mention anything about package.json or anything like that, you just use the layer ARN: https://serverless.com/framework/docs/providers/aws/guide/layers#using-your-layers
from git-lambda-layer.
Thanks for taking the time to look this through.
You are correct. If one will use an existing layer (e.g. the arns provided as part of git-lambda-layer) no package.json is needed.
As I far as I know, given a layer's arn one cannot inspect its code (e.g. for an audit). So if there are security/traceability concerns it might be necessary to deploy one's own git-lambda-layer (instead of using the arns provided in the git-lambda-layer README.md).
When using serverless
to deploy the layer the zip bundle should be local so it can be uploaded as part of the serverless
service.
That is where the devDependencies
come up: so the git-lambda-layer zip bundle can be present locally to upload it along side a serverless
service.
Hopefully this clarifies the use case and need for package.json
Please let me know in case you have any further questions.
from git-lambda-layer.
You can absolutely inspect layers, eg:
$ aws lambda get-layer-version --layer-name 'arn:aws:lambda:us-east-1:800406105498:layer:nsolid-node-8' --version-number 3
(replace with the git-lambda-layer
ARN or any other public layer)
That will give you a url in Content.Location
where you can download the layer to inspect and audit.
The reason I'm pushing back on this is that I don't really want people to npm install this – it's not the correct way to use it – even with the serverless framework AFAICT – much easier just to use the ARNs.
from git-lambda-layer.
Good, I am fine with that.
Thanks for pointing out how to get the layer code.
from git-lambda-layer.
No probs, thanks for understanding 👍
from git-lambda-layer.
Related Issues (20)
- Nodejs12 doesn't seem to be working with layer v3? HOT 2
- Lambda nodejs12.x - Permission denied (Public Key) HOT 2
- Could you add the build process? HOT 3
- File too short on shared library libpcre2-8.so.0 HOT 6
- Add support for git lfs HOT 4
- Cannot load PCRE HOT 6
- AccessDeniedException on Gov Cloud? HOT 4
- Python import git module error for AWS Lambda HOT 1
- Lambda -> Git SSH Authentication HOT 13
- Could not deploy because lambda with layer exceeded 250 mb... HOT 3
- How to use "git push" ? HOT 7
- Support for GIT v2.30.2 because of Security Vulnerability HOT 3
- [Question] Uploading my own zip file HOT 5
- Support for using layer.zip with AWS Lambda containers HOT 7
- Support for using aws cli executable
- clone with ssh protocol hit issues
- Support for arm64 lambdas HOT 3
- How can I create my own layer? HOT 4
- using layer with python in Lambda function HOT 2
- Update to latest versions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-lambda-layer.