Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow lambdaArn to be specified as an arn or a function name #17

Merged
merged 4 commits into from
Oct 10, 2018

Conversation

marchuffnagle
Copy link
Contributor

No description provided.

Copy link

@ifestus ifestus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea, but I have one question.

index.js Outdated
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 = `cumulus-ecs-task/${getFunctionName(lambdaArn)}`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we losing valuable functionality by no longer catching the case in which the lambdaArn actually isn't a lambdaArn? I may be mistaken, but it appears that under the proposed implementation, any parameter passed into getFunctionName that doesn't begin with arn:aws:lambda will be returned as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the issue is that the parameter is called lambdaArn, but it apparently accepts a Lambda function name as well as an ARN. We need to add the Lambda function name to the logs, though, so the two cases here are that 1) the parameter is an ARN or 2) the parameter is a simple Lambda function name already.

@marchuffnagle marchuffnagle merged commit 99204ae into master Oct 10, 2018
@marchuffnagle marchuffnagle deleted the CUMULUS-953 branch October 10, 2018 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants