Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
serverless-lambda-edge-pre-existing-cloudfront
Advanced tools
The Serverless Framework plugin which creates Lambda@Edge against pre-existing CloudFront.
A Serverless Framework plugin which associates Lambda@Edge against pre-existing CloudFront distributions.
You can install this plugin from npm registry.
$ npm install --save-dev serverless-lambda-edge-pre-existing-cloudfront
Configure serverless.yml
functions:
viewerRequest:
handler: lambdaEdge/viewerRequest.handler
events:
- preExistingCloudFront:
# ---- Mandatory Properties -----
distributionId: xxxxxxx # CloudFront distribution ID you want to associate
eventType: viewer-request # Choose event to trigger your Lambda function, which are `viewer-request`, `origin-request`, `origin-response` or `viewer-response`
pathPattern: '*' # Specifying the CloudFront behavior
includeBody: false # Whether including body or not within request
# ---- Optional Property -----
stage: dev # Specify the stage at which you want this CloudFront distribution to be updated
plugins:
- serverless-lambda-edge-pre-existing-cloudfront
Run deploy
$ serverless deploy
You can specify additional configurations a lambdaEdgePreExistingCloudFront
value in the custom section of your serverless.yml file.
A validStages
value allows you to specify valid stage names for deploy Lambda@Edge.
lambdaEdgePreExistingCloudFront:
validStages:
- staging
- production
validStages
and stage
properties workThis plugin will first check for validStages
property defined in the custom
section. If validStages
is used, then all the preExistingCloudFront
events are only possible to be updated at the validStages
. If not used, all the preExistingCloudFront
events are possible to be updated at any stage.
Then at all valid stages, the plugin checks - for each preExistingCloudFront
event - if the provider's stage is the same as the stage
property defined for each preExistingCloudFront
event. If they match, then that particular preExistingCloudFront
event will be updated.
If stage
is not used for a preExistingCloudFront
event, then that event will be updated at all validStages
or all stages if validStages
is not used.
FAQs
The Serverless Framework plugin which creates Lambda@Edge against pre-existing CloudFront.
The npm package serverless-lambda-edge-pre-existing-cloudfront receives a total of 2,735 weekly downloads. As such, serverless-lambda-edge-pre-existing-cloudfront popularity was classified as popular.
We found that serverless-lambda-edge-pre-existing-cloudfront 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.