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.1.0 to 1.1.1

32

index.js

@@ -14,7 +14,17 @@ 'use strict'

'after:aws:deploy:finalize:cleanup': async () => {
this.serverless.service.getAllFunctions().forEach(async (functionName) => {
const functionObj = this.serverless.service.getFunction(functionName)
if (functionObj.events) {
functionObj.events.forEach(async (event) => {
if (event.preExistingCloudFront && this.checkAllowedDeployStage()) {
await this.serverless.service
.getAllFunctions()
.filter((functionName) => {
const functionObj = this.serverless.service.getFunction(functionName)
return functionObj.events
})
.reduce((promiseOutput, functionName) => {
return promiseOutput.then(async () => {
const functionObj = this.serverless.service.getFunction(functionName)
const events = functionObj.events.filter(
(event) => event.preExistingCloudFront && this.checkAllowedDeployStage()
)
for (let idx = 0; idx < events.length; idx += 1) {
const event = events[idx]
const functionArn = await this.getlatestVersionLambdaArn(functionObj.name)

@@ -41,3 +51,7 @@ const config = await this.provider.request('CloudFront', 'getDistribution', {

this.provider.request('CloudFront', 'updateDistribution', {
this.serverless.cli.consoleLog(
`${functionArn} is associating to ${event.preExistingCloudFront.distributionId} CloudFront Distribution. waiting for deployed status.`
)
await this.provider.request('CloudFront', 'updateDistribution', {
Id: event.preExistingCloudFront.distributionId,

@@ -47,9 +61,5 @@ IfMatch: config.ETag,

})
this.serverless.cli.consoleLog(
`${functionArn} is associating to ${event.preExistingCloudFront.distributionId} CloudFront Distribution. waiting for deployed status.`
)
}
})
}
})
}, Promise.resolve())
}

@@ -56,0 +66,0 @@ }

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

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

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