1656648240
Add scripting capabilities to the Serverless Framework.
This project is in maintenance mode, and it will not get any new features.
Install the plugin in your Serverless (v1.0 or higher) project:
npm install --save serverless-plugin-scripts
And activate it by adding the following configuration to your serverless.yml
file:
plugins:
- serverless-plugin-scripts
To add a custom command to the Serverless CLI, just define a custom.scripts.commands
property in your serverless.yml
file:
custom:
scripts:
commands:
hello: echo Hello from ${self:service} service!
You can now run serverless hello
to execute the hello
command.
It is possible to define simple hooks for existing Serverless CLI commands by adding a custom.scripts.hooks
property in your serverless.yml
file:
custom:
scripts:
hooks:
'deploy:createDeploymentArtifacts': npm run compile
The next time you run serverless deploy
, your script will be automatically invoked during the deploy:createDeploymentArtifacts
lifecycle event.
To find out about existing lifecycle events, check out this page.
Author: Mvila
Source Code: https://github.com/mvila/serverless-plugin-scripts
License: MIT
1655426640
Serverless M (or Serverless Modular) is a plugin for the serverless framework. This plugins helps you in managing multiple serverless projects with a single serverless.yml file. This plugin gives you a super charged CLI options that you can use to create new features, build them in a single file and deploy them all in parallel
Currently this plugin is tested for the below stack only
Make sure you have the serverless CLI installed
# Install serverless globally
$ npm install serverless -g
To start the serverless modular project locally you can either start with es5 or es6 templates or add it as a plugin
# Step 1. Download the template
$ sls create --template-url https://github.com/aa2kb/serverless-modular/tree/master/template/modular-es6 --path myModularService
# Step 2. Change directory
$ cd myModularService
# Step 3. Create a package.json file
$ npm init
# Step 3. Install dependencies
$ npm i serverless-modular serverless-webpack webpack --save-dev
# Step 1. Download the template
$ sls create --template-url https://github.com/aa2kb/serverless-modular/tree/master/template/modular-es5 --path myModularService
# Step 2. Change directory
$ cd myModularService
# Step 3. Create a package.json file
$ npm init
# Step 3. Install dependencies
$ npm i serverless-modular --save-dev
If you dont want to use the templates above you can just add in your existing project
plugins:
- serverless-modular
Now you are all done to start building your serverless modular functions
The serverless CLI can be accessed by
# Serverless Modular CLI
$ serverless modular
# shorthand
$ sls m
Serverless Modular CLI is based on 4 main commands
sls m init
sls m feature
sls m function
sls m build
sls m deploy
sls m init
The serverless init command helps in creating a basic .gitignore
that is useful for serverless modular.
The basic .gitignore
for serverless modular looks like this
#node_modules
node_modules
#sm main functions
sm.functions.yml
#serverless file generated by build
src/**/serverless.yml
#main serverless directories generated for sls deploy
.serverless
#feature serverless directories generated sls deploy
src/**/.serverless
#serverless logs file generated for main sls deploy
.sm.log
#serverless logs file generated for feature sls deploy
src/**/.sm.log
#Webpack config copied in each feature
src/**/webpack.config.js
The feature command helps in building new features for your project
This command comes with three options
--name: Specify the name you want for your feature
--remove: set value to true if you want to remove the feature
--basePath: Specify the basepath you want for your feature, this base path should be unique for all features. helps in running offline with offline plugin and for API Gateway
options | shortcut | required | values | default value |
---|---|---|---|---|
--name | -n | ✅ | string | N/A |
--remove | -r | ❎ | true, false | false |
--basePath | -p | ❎ | string | same as name |
Creating a basic feature
# Creating a jedi feature
$ sls m feature -n jedi
Creating a feature with different base path
# A feature with different base path
$ sls m feature -n jedi -p tatooine
Deleting a feature
# Anakin is going to delete the jedi feature
$ sls m feature -n jedi -r true
The function command helps in adding new function to a feature
This command comes with four options
--name: Specify the name you want for your function
--feature: Specify the name of the existing feature
--path: Specify the path for HTTP endpoint helps in running offline with offline plugin and for API Gateway
--method: Specify the path for HTTP method helps in running offline with offline plugin and for API Gateway
options | shortcut | required | values | default value |
---|---|---|---|---|
--name | -n | ✅ | string | N/A |
--feature | -f | ✅ | string | N/A |
--path | -p | ❎ | string | same as name |
--method | -m | ❎ | string | 'GET' |
Creating a basic function
# Creating a cloak function for jedi feature
$ sls m function -n cloak -f jedi
Creating a basic function with different path and method
# Creating a cloak function for jedi feature with custom path and HTTP method
$ sls m function -n cloak -f jedi -p powers -m POST
The build command helps in building the project for local or global scope
This command comes with four options
--scope: Specify the scope of the build, use this with "--feature" tag
--feature: Specify the name of the existing feature you want to build
options | shortcut | required | values | default value |
---|---|---|---|---|
--scope | -s | ❎ | string | local |
--feature | -f | ❎ | string | N/A |
Saving build Config in serverless.yml
You can also save config in serverless.yml file
custom:
smConfig:
build:
scope: local
all feature build (local scope)
# Building all local features
$ sls m build
Single feature build (local scope)
# Building a single feature
$ sls m build -f jedi -s local
All features build global scope
# Building all features with global scope
$ sls m build -s global
The deploy command helps in deploying serverless projects to AWS (it uses sls deploy
command)
This command comes with four options
--sm-parallel: Specify if you want to deploy parallel (will only run in parallel when doing multiple deployments)
--sm-scope: Specify if you want to deploy local features or global
--sm-features: Specify the local features you want to deploy (comma separated if multiple)
options | shortcut | required | values | default value |
---|---|---|---|---|
--sm-parallel | ❎ | ❎ | true, false | true |
--sm-scope | ❎ | ❎ | local, global | local |
--sm-features | ❎ | ❎ | string | N/A |
--sm-ignore-build | ❎ | ❎ | string | false |
Saving deploy Config in serverless.yml
You can also save config in serverless.yml file
custom:
smConfig:
deploy:
scope: local
parallel: true
ignoreBuild: true
Deploy all features locally
# deploy all local features
$ sls m deploy
Deploy all features globally
# deploy all global features
$ sls m deploy --sm-scope global
Deploy single feature
# deploy all global features
$ sls m deploy --sm-features jedi
Deploy Multiple features
# deploy all global features
$ sls m deploy --sm-features jedi,sith,dark_side
Deploy Multiple features in sequence
# deploy all global features
$ sls m deploy --sm-features jedi,sith,dark_side --sm-parallel false
Author: aa2kb
Source Code: https://github.com/aa2kb/serverless-modular
License: MIT license
1656648240
Add scripting capabilities to the Serverless Framework.
This project is in maintenance mode, and it will not get any new features.
Install the plugin in your Serverless (v1.0 or higher) project:
npm install --save serverless-plugin-scripts
And activate it by adding the following configuration to your serverless.yml
file:
plugins:
- serverless-plugin-scripts
To add a custom command to the Serverless CLI, just define a custom.scripts.commands
property in your serverless.yml
file:
custom:
scripts:
commands:
hello: echo Hello from ${self:service} service!
You can now run serverless hello
to execute the hello
command.
It is possible to define simple hooks for existing Serverless CLI commands by adding a custom.scripts.hooks
property in your serverless.yml
file:
custom:
scripts:
hooks:
'deploy:createDeploymentArtifacts': npm run compile
The next time you run serverless deploy
, your script will be automatically invoked during the deploy:createDeploymentArtifacts
lifecycle event.
To find out about existing lifecycle events, check out this page.
Author: Mvila
Source Code: https://github.com/mvila/serverless-plugin-scripts
License: MIT
1622015491
Hey peeps, Hope you all are safe & going well
Many entrepreneurs & startups are interested to start a crypto exchange platform by using a cryptocurrency exchange script, you know why??? Let me explain. Before that, you need to know what is a cryptocurrency exchange script???
Cryptocurrency Exchange Script is an upgrade version of all exchange platforms, it is also called ready-made script or software. By using the crypto exchange script you can launch your crypto trading platform instantly. It is one of the easiest and fastest ways to start your crypto exchange business. Also, it helps to launch your exchange platform within 7 days.
The More Important one is “Where to get the best bitcoin exchange script?”
No one couldn’t answer the question directly because a lot of software/script providers are available in the crypto market. Among them, finding the best script provider is not an easy task. You don’t worry about that. I will help you. I did some technical inspection to find the best bitcoin exchange script provider in the techie world. Speaking of which, one software provider, Coinsclone got my attention. They have successfully delivered 100+ secured bitcoin exchanges, wallets & payment gateways to their global clients. No doubt that their exchange software is 100% bug-free and it is tightly secured. They consider customer satisfaction as their priority and they are always ready to customize your exchange based on your desired business needs.
Of course, it kindles your business interest; but before leaping, you can check their free live demo at Bitcoin Exchange Script.
Are you interested in business with them, then connect their business experts directly via
Whatsapp/Telegram: +919500575285
Mail: hello@coinsclone.com
Skype: live:hello_20214
#bitcoin exchange script #cryptocurrency exchange script #crypto exchange script #bitcoin exchange script #bitcoin exchange clone script #crypto exchange clone script
1617602685
Are you wanting to be an Entrepreneur? A Business using cryptocurrency? Then this article is for you.
As a beginner, always one prefers fair play. But to the least, initiating business in the streams of cryptocurrency carries a varying degree of risks. We all know that, Every business packs the profit only if we are ready to take risks. But flabbergast is, you can avoid unnecessary risk, If you choose our Twisted HYIP Investment script. You don’t need to play poker with your hard-earned Money.
Using minimal investment, You can start a beneficial business.
Craze for cryptocurrency is now seeming to be unlimited, Using the Twisted HYIP platform you will get funds for running the lending business- this is the one line of the process.
First, let me make plain, How our traditional HYIP works?
You can create a number of investment plans with attractive and promising Rate of interest. Investors will invest in those plans and get their interest periodically.
How you will provide them interest? You have to collect the investments and use them for your own project, Trading, Stock marketing and so on.
What if you don’t find a right platform to grow your investor’s funds. You will lack in processing their interest, and it will be filthy, right?
How it works?
So this Twisted HYIP platform clear this shady cloud and brings you the best place to grow your investors’ funds. With our platform you can run Investment as well as lending platform together. You will run a traditional HYIP script for your investors stating the fixed Rate of interest with validity for processing their principle back.
Instead of using the crowded funds in different platform, You can use it for lending to borrowers in your platform at an interest rate higher than promised to your investors. Now you can pay back the investors as well as you will get a constant flow of income for you.
Instead of generating promised interest rate daily or monthly, You can also make it as a doubler with long term duration. So you can use the investors fund as well as lenders repay again and again.
Every investor can monitor their investment growth in their dashboard. They will get back their invested amount plus additional ROI only when their investment gets matures. But they can see, how their wallet is loaded with profits without any risk.
Possibility of being a Profitable business
Crucial bits of Twisted HYIP
Cryptocurrency market is blooming one, as per the voices of many financial expertise, prediction for end of digital currency is a blue moon. This twisted HYIP will create its own market as a perception for profit is getting increased every day among the people.
Now are you ready to launch your own lending platform? then Connect with KIR HYIP to know more interesting features about the platform. There is always space to add your ideas.
Under a short span of time, launch your own turnkey based lending platform. The World is running behind Profit, what are you waiting for? Join the club now and get the free HYIP software demo!
#hyip script #hyip investment script #bitcoin hyip script #buy hyip script #best hyip script #hyip investment script
1653578100
Datadog recommends the Serverless Framework Plugin for developers using the Serverless Framework to deploy their serverless applications. The plugin automatically enables instrumentation for applications to collect metrics, traces, and logs by:
addExtension
) or subscribing the Datadog Forwarder to your Lambda functions' log groups (forwarderArn
).To quickly get started, follow the installation instructions for Python, Node.js, Ruby, Java, Go, or .NET and view your function's enhanced metrics, traces, and logs in Datadog.
After installation is complete, configure the advanced options to suit your monitoring needs.
Each version of the plugin is published with a specific set of versions of the Datadog Lambda layers. To pick up new features and bug fixes provided by the latest versions of Datadog Lambda layers, upgrade the serverless framework plugin. Test the new version before applying it on your production applications.
To further configure your plugin, use the following custom parameters in your serverless.yml
:
Parameter | Description |
---|---|
site | Set which Datadog site to send data to, such as datadoghq.com (default), datadoghq.eu , us3.datadoghq.com , us5.datadoghq.com , or ddog-gov.com . This parameter is required when collecting telemtry using the Datadog Lambda Extension. |
apiKey | [Datadog API key][7]. This parameter is required when collecting telemetry using the Datadog Lambda Extension. Alternatively, you can also set the DATADOG_API_KEY environment variable in your deployment environment. |
appKey | Datadog app key. Only needed when the monitors field is defined. Alternatively, you can also set the DATADOG_APP_KEY environment variable in your deployment environment. |
apiKeySecretArn | An alternative to using the apiKey field. The ARN of the secret that is storing the Datadog API key in AWS Secrets Manager. Remember to add the secretsmanager:GetSecretValue permission to the Lambda execution role. |
apiKMSKey | An alternative to using the apiKey field. Datadog API key encrypted using KMS. Remember to add the kms:Decrypt permission to the Lambda execution role. |
env | When set along with addExtension , a DD_ENV environment variable is added to all Lambda functions with the provided value. Otherwise, an env tag is added to all Lambda functions with the provided value. Defaults to the stage value of the serverless deployment. |
service | When set along with addExtension , a DD_SERVICE environment variable is added to all Lambda functions with the provided value. Otherwise, a service tag is added to all Lambda functions with the provided value. Defaults to the service value of the serverless project. |
version | When set along with addExtension , a DD_VERSION environment variable is added to all Lambda functions with the provided value. When set along with forwarderArn , a version tag is added to all Lambda functions with the provided value. |
tags | A comma separated list of key :value pairs as a single string. When set along with extensionLayerVersion , a DD_TAGS environment variable is added to all Lambda functions with the provided value. When set along with forwarderArn , the plugin parses the string and sets each key :value pair as a tag on all Lambda functions. |
enableXrayTracing | Set true to enable X-Ray tracing on the Lambda functions and API Gateway integrations. Defaults to false . |
enableDDTracing | Enable Datadog tracing on the Lambda function. Defaults to true . |
enableDDLogs | Enable Datadog log collection using the Lambda Extension. Defaults to true . Note: This setting has no effect on logs sent by the Datadog Forwarder. |
monitors | When defined, the Datadog plugin configures monitors for the deployed function. Requires setting DATADOG_API_KEY and DATADOG_APP_KEY in your environment. To learn how to define monitors, see To Enable and Configure a Recommended Serverless Monitor. |
captureLambdaPayload | [Captures incoming and outgoing AWS Lambda payloads][17] in the Datadog APM spans for Lambda invocations. Defaults to false . |
enableSourceCodeIntegration | Enable [Datadog source code integration][18] for the function. Defaults to true . |
subscribeToApiGatewayLogs | Enable automatic subscription of the Datadog Forwarder to API Gateway log groups. Requires setting forwarderArn . Defaults to true . |
subscribeToHttpApiLogs | Enable automatic subscription of the Datadog Forwarder to HTTP API log groups. Requires setting forwarderArn . Defaults to true . |
subscribeToWebsocketLogs | Enable automatic subscription of the Datadog Forwarder to WebSocket log groups. Requires setting forwarderArn . Defaults to true . |
forwarderArn | The ARN of the Datadog Forwarder to be subscribed to the Lambda or API Gateway log groups. |
addLayers | Whether to install the Datadog Lambda library as a layer. Defaults to true . Set to false when you plan to package the Datadog Lambda library to your function's deployment package on your own so that you can install a specific version of the Datadog Lambda library ([Python][8] or [Node.js][9]). |
addExtension | Whether to install the Datadog Lambda Extension as a layer. Defaults to true . When enabled, it's required to set the apiKey and site . |
exclude | When set, this plugin ignores all specified functions. Use this parameter if you have any functions that should not include Datadog functionality. Defaults to [] . |
enabled | When set to false , the Datadog plugin stays inactive. Defaults to true . You can control this option using an environment variable. For example, use enabled: ${strToBool(${env:DD_PLUGIN_ENABLED, true})} to activate/deactivate the plugin during deployment. Alternatively, you can also use the value passed in through --stage to control this option—see example. |
customHandler | When set, the specified handler is set as the handler for all the functions. |
failOnError | When set, this plugin throws an error if any custom Datadog monitors fail to create or update. This occurs after deploy, but will cause the result of serverless deploy to return a nonzero exit code (to fail user CI). Defaults to false . |
integrationTesting | Set true when running integration tests. This bypasses the validation of the Forwarder ARN and the addition of Datadog Monitor output links. Defaults to false . |
logLevel | The log level, set to DEBUG for extended logging. |
To use any of these parameters, add a custom
> datadog
section to your serverless.yml
similar to this example:
custom:
datadog:
apiKeySecretArn: "{Datadog_API_Key_Secret_ARN}"
enableXrayTracing: false
enableDDTracing: true
enableDDLogs: true
subscribeToAccessLogs: true
forwarderArn: arn:aws:lambda:us-east-1:000000000000:function:datadog-forwarder
exclude:
- dd-excluded-function
If you are using a bundler, such as webpack, see Serverless Tracing and Webpack.
You may encounter the error of missing type definitions. To resolve the error, add datadog-lambda-js
and dd-trace
to the devDependencies
list of your project's package.json.
If you are using serverless-typescript, make sure that serverless-datadog
is above the serverless-typescript
entry in your serverless.yml
. The plugin will automatically detect .ts
files.
plugins:
- serverless-plugin-datadog
- serverless-typescript
If you'd like to turn off the plugin based on the environment (passed via --stage
), you can use something similar to the example below.
provider:
stage: ${self:opt.stage, 'dev'}
custom:
staged: ${self:custom.stageVars.${self:provider.stage}, {}}
stageVars:
dev:
dd_enabled: false
datadog:
enabled: ${self:custom.staged.dd_enabled, true}
There are seven recommended monitors with default values pre-configured.
Monitor | Metrics | Threshold | Serverless Monitor ID |
---|---|---|---|
High Error Rate | aws.lambda.errors /aws.lambda.invocations | >= 10% | high_error_rate |
Timeout | aws.lambda.duration.max /aws.lambda.timeout | >= 1 | timeout |
Out of Memory | aws.lambda.enhanced.out_of_memory | > 0 | out_of_memory |
High Iterator Age | aws.lambda.iterator_age.maximum | >= 24 hrs | high_iterator_age |
High Cold Start Rate | aws.lambda.enhanced.invocations(cold_start:true) /aws.lambda.enhanced.invocations | >= 20% | high_cold_start_rate |
High Throttles | aws.lambda.throttles /aws.lambda.invocations | >= 20% | high_throttles |
Increased Cost | aws.lambda.enhanced.estimated_cost | ↑20% | increased_cost |
To create a recommended monitor, you must use its respective serverless monitor ID. Note that you must also set the DATADOG_API_KEY
and DATADOG_APP_KEY
in your environment.
If you’d like to further configure the parameters for a recommended monitor, you can directly define the parameter values below the serverless monitor ID. Parameters not specified under a recommended monitor will use the default recommended value. The query
parameter for recommended monitors cannot be directly modified and will default to using the query
valued as defined above; however, you may change the threshold value in query
by re-defining it within the options
parameter. To delete a monitor, remove the monitor from the serverless.yml
template. For further documentation on how to define monitor parameters, see the Datadog Monitors API.
Monitor creation occurs after the function is deployed. In the event that a monitor is unsuccessfully created, the function will still be successfully deployed.
To create a recommended monitor with the default values
Define the appropriate serverless monitor ID without specifying any parameter values
custom:
datadog:
addLayers: true
monitors:
- high_error_rate:
To configure a recommended monitor
custom:
datadog:
addLayers: true
monitors:
- high_error_rate:
name: "High Error Rate with Modified Warning Threshold"
message: "More than 10% of the function’s invocations were errors in the selected time range. Notify @data.dog@datadoghq.com @slack-serverless-monitors"
tags: ["modified_error_rate", "serverless", "error_rate"]
require_full_window: true
priority: 2
options:
include_tags: true
notify_audit: true
thresholds:
ok: 0.025
warning: 0.05
To delete a monitor
Removing the serverless monitor ID and its parameters will delete the monitor.
To define a custom monitor, you must define a unique serverless monitor ID string in addition to passing in the API key and Application key, DATADOG_API_KEY
and DATADOG_APP_KEY
, in your environment. The query
parameter is required but every other parameter is optional. Define a unique serverless monitor ID string and specify the necessary parameters below. For further documentation on monitor parameters, see the Datadog Monitors API.
custom:
datadog:
addLayers: true
monitors:
- custom_monitor_id:
name: "Custom Monitor"
query: "max(next_1w):forecast(avg:system.load.1{*}, 'linear', 1, interval='60m', history='1w', model='default') >= 3"
message: "Custom message for custom monitor. Notify @data.dog@datadoghq.com @slack-serverless-monitors"
tags: ["custom_monitor", "serverless"]
priority: 3
options:
enable_logs_sample: true
require_full_window: true
include_tags: false
notify_audit: true
notify_no_data: false
thresholds:
ok: 1
warning: 2
service
and env
tags through environment variables instead of Lambda resource tags.enableTags
parameter was replaced by the new service
, env
parameters.If you encounter a bug with this package, let us know by filing an issue! Before opening a new issue, please search the existing issues to avoid duplicates.
When opening an issue, include your Serverless Framework version, Python/Node.js version, and stack trace if available. Also, please include the steps to reproduce when appropriate.
You can also open an issue for a feature request.
If you find an issue with this package and have a fix, open a pull request following the procedures.
For product feedback and questions, join the #serverless
channel in the Datadog community on Slack.
Author: DataDog
Source Code: https://github.com/DataDog/serverless-plugin-datadog
License: View license