
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
serverless-cli-v3
Advanced tools
This tool was created to optimize the creation time of client specific integrations and to define a standard in file and folder structures.
It also accelerates the exchange of knowledge with other teams in other parts of the world 🌎. This update of the tools makes goes in hand with the update of flow to Studio-NG
ysc [options] [command]
-V, --version output the version number
-h, --help output usage information
init Create a new base project for serverless (lambdas)
add-lambda Create a new base lambda scripts for the serverless (with its respective unit-test)
generate [options] Generate the following files: serveless.yml, README.md, docs.md
Usage: init [options]
Create a new base project for serverless (lambdas)
Options:
-h, --help output usage information
Usage: add-lambda [options]
Create a new base lambda scripts for the serverless (with its respective unit-test)
Options:
-h, --help output usage information
Usage: generate [options]
Generate the following files: serveless.yml, README.md, docs.md
Options:
-s --stage <stage> Serverless stage (staging or production) (default: "staging")
--no-serverless Do not generate the serverless.yml
-h, --help output usage information
In order to generate the serverless.yml
file with all lambdas' settings (environment vars, secrets, networking configs, etc), it is required to place those configurations on the yalo-config.json
file.
Currently it is possible to map the following features from the yalo-config.json
file to the serverless.yml
(the one generated by the CLI generate
command):
/${project-prefix}/${stage}/${var-name}
.aeromexico
, femsa-mx
, pepsico-ch
, etc. This is mainly for identifying a group of lambda functions' performance/health on Datadog. It is suggested to put as an slugified version of the customer's name, and maybe also the country code if it's a global account.{
"aws": {
"service": "MyServerlessProjectService",
"prefix": "my-serverless-project",
"customer": "my-customer",
"region": "us-east-1",
"runtime": "nodejs10.x",
"vpc": {
"securityGroups": [
"sg-05a7c1fa7e055cc89"
],
"subnets": [
"subnet-0494f36d5918a3d0b",
"subnet-02603079c20f46758"
]
},
"envVars": {
"globals": {
"staging": {
"myGlobalVar": "myGlobalVarStagingValue"
},
"production": {
"myGlobalVar": "myGlobalVarProdValue"
}
},
"functions": {
"do-something": {
"staging": {
"myDoSomethingVar": "myDoSomethingVarStagingValue"
},
"production": {
"myDoSomethingVar": "myDoSomethingVarProdValue"
}
}
}
},
"ssmVars": {
"globals": [
"myGlobalSSMVar", "myOtherGlobalSSMVar"
],
"functions": {
"do-something": [
"myDoSomethingSSMVar"
]
}
}
}
}
The generate
command will set any custom tag defined on a lambda function inside the serverless.yml
file definition.
To set any custom tag, you need to add it on your lambda function metadata
variable. Like the following:
...
const metadata = {
description: 'My lambda function description',
timeout: 180,
tags: [
{ key: 'datadog', value: true },
{ key: 'yalo-feature', value: 'my-feature' },
],
}
...
const handler = async (event, context, callback) => {
...
// handler code
...
}
...
module.exports = {
handler,
metadata,
schema,
}
The task of making the yalo-config.json
file with all lambdas' configurations can get somewhat tedious, particularly on projects with several lambda functions.
To help you a little with this, you can get a concentrate of all your project's settings by using the backup-lambdas script. That concentrate might be handy to identify all the Serverless settings that need to be mapped to the yalo-config.json
file.
FAQs
Yalo serverless CLI v3
We found that serverless-cli-v3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.