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

@cumulus/cumulus-ecs-task

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cumulus/cumulus-ecs-task - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

6

CHANGELOG.md

@@ -9,2 +9,8 @@ # cumulus-ecs-task change log

## [v1.2.4]
### Fixed
- **CUMULUS-953** - The lambdaArn parameter will accept a Lambda ARN or a Lambda
function name.
## [v1.2.3]

@@ -11,0 +17,0 @@

49

index.js

@@ -0,3 +1,5 @@

/* eslint max-len: "off" */
'use strict';
/* eslint-disable no-console, max-len */
const https = require('https');

@@ -18,2 +20,20 @@ const path = require('path');

// eslint-disable-next-line require-jsdoc
const isLambdaFunctionArn = (id) => id.startsWith('arn:aws:lambda');
// eslint-disable-next-line require-jsdoc
function getFunctionName(lambdaId) {
if (isLambdaFunctionArn(lambdaId)) {
const FUNCTION_NAME_FIELD = 6;
return lambdaId.split(':')[FUNCTION_NAME_FIELD];
}
return lambdaId;
}
// eslint-disable-next-line require-jsdoc
const getLogSenderFromLambdaId = (lambdaId) =>
`cumulus-ecs-task/${getFunctionName(lambdaId)}`;
/**

@@ -257,10 +277,3 @@ * Download a URL to file

const lambdaFunctionNameMatch = lambdaArn.match(/:function:([^:]+)/);
if (lambdaFunctionNameMatch) {
log.sender = `cumulus-ecs-task/${lambdaFunctionNameMatch[1]}`;
}
else {
const err = new TypeError(`Unable to determine lambda function name from ${lambdaArn}`);
log.error(`Unable to determine lambda function name from ${lambdaArn}`, err);
}
log.sender = getLogSenderFromLambdaId(lambdaArn);

@@ -313,10 +326,3 @@ // the cumulus-message-adapter dir is in an unexpected place,

const lambdaFunctionNameMatch = lambdaArn.match(/:function:([^:]+)/);
if (lambdaFunctionNameMatch) {
log.sender = `cumulus-ecs-task/${lambdaFunctionNameMatch[1]}`;
}
else {
const err = new TypeError(`Unable to determine lambda function name from ${lambdaArn}`);
log.error(`Unable to determine lambda function name from ${lambdaArn}`, err);
}
log.sender = getLogSenderFromLambdaId(lambdaArn);

@@ -397,10 +403,3 @@ // the cumulus-message-adapter dir is in an unexpected place,

const lambdaFunctionNameMatch = lambdaArn.match(/:function:([^:]+)/);
if (lambdaFunctionNameMatch) {
log.sender = `cumulus-ecs-task/${lambdaFunctionNameMatch[1]}`;
}
else {
const err = new TypeError(`Unable to determine lambda function name from ${lambdaArn}`);
log.error(`Unable to determine lambda function name from ${lambdaArn}`, err);
}
log.sender = getLogSenderFromLambdaId(lambdaArn);

@@ -407,0 +406,0 @@ // the cumulus-message-adapter dir is in an unexpected place,

{
"name": "@cumulus/cumulus-ecs-task",
"version": "1.2.3",
"version": "1.2.4",
"description": "Run lambda functions in ECS",

@@ -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