Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serverless-lambda-edge-pre-existing-cloudfront

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-lambda-edge-pre-existing-cloudfront - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

19

index.js

@@ -18,3 +18,3 @@ 'use strict'

functionObj.events.forEach(async (event) => {
if (event.preExistingCloudFront) {
if (event.preExistingCloudFront && this.checkAllowedDeployStage()) {
const functionArn = await this.getlatestVersionLambdaArn(functionObj.name)

@@ -57,2 +57,19 @@ const config = await this.provider.request('CloudFront', 'getDistribution', {

checkAllowedDeployStage() {
if (
this.serverless.service.custom &&
this.serverless.service.custom.lambdaEdgePreExistingCloudFront &&
this.serverless.service.custom.lambdaEdgePreExistingCloudFront.validStages
) {
if (
this.serverless.service.custom.lambdaEdgePreExistingCloudFront.validStages.indexOf(
this.stage
) < 0
) {
return false
}
}
return true
}
async associateNonDefaultCacheBehaviors(cacheBehaviors, event, functionName, functionArn) {

@@ -59,0 +76,0 @@ for (let i = 0; i < cacheBehaviors.Items.length; i++) {

2

package.json
{
"name": "serverless-lambda-edge-pre-existing-cloudfront",
"version": "1.0.0",
"version": "1.1.0",
"description": "The Serverless Framework plugin which creates Lambda@Edge against pre-existing CloudFront.",

@@ -5,0 +5,0 @@ "main": "index.js",

# Serverless Lambda Edge PreExisting CloudFront
The Serverless Framework plugin which associates Lambda@Edge against pre-existing CloudFront distribution.
A Serverless Framework plugin which associates Lambda@Edge against pre-existing CloudFront distributions.

@@ -14,3 +14,3 @@ ## Install

Here is configuration in your serverless.yml
Configure serverless.yml

@@ -32,5 +32,15 @@ ```yaml

And run deploy
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.
```yaml
lambdaEdgePreExistingCloudFront:
validStages:
- staging
- production
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc