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

Breaks or not while handling Lambda filter,mapper errors #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

acharp
Copy link
Member

@acharp acharp commented Oct 5, 2016

This change is Reviewable

@germangh
Copy link
Member

germangh commented Oct 6, 2016

Review status: 0 of 3 files reviewed at latest revision, 2 unresolved discussions.


humilis_push_processor/lambda_function/handler/init.py, line 113 at r1 (raw file):

    if "{{sns_topic_name}}" == "None":
        logger.error("No SNS Topic name provided, layer push-processor "
                     "needs one to report the errors.")

This should be a CriticalError. Otherwise the error will only show up in the logs, which nobody ever looks at without a notification first.


humilis_push_processor/lambda_function/handler/init.py, line 115 at r1 (raw file):

                     "needs one to report the errors.")
    else:
        sns = boto3.client("sns")

Instead of having sns_topic_name as the parameter for the layer I would have sns_topic_arn. Then you avoid calls to boto3, and you can also simplify a bit the CF resources file. Also, since the SNS topic is not part of this application but something set up externally it makes more sense to use the ARN. What if the user wanted to send the notification to an SNS topic in another AWS region? Or in another AWS account?


Comments from Reviewable

@acharp acharp force-pushed the break-or-not-on-error branch from 265953c to 622e3ba Compare October 7, 2016 13:58
@acharp
Copy link
Member Author

acharp commented Oct 7, 2016

Review status: 0 of 3 files reviewed at latest revision, 2 unresolved discussions.


humilis_push_processor/lambda_function/handler/init.py, line 113 at r1 (raw file):

Previously, germangh (German Gomez-Herrero) wrote…

This should be a CriticalError. Otherwise the error will only show up in the logs, which nobody ever looks at without a notification first.

Done.

humilis_push_processor/lambda_function/handler/init.py, line 115 at r1 (raw file):

Previously, germangh (German Gomez-Herrero) wrote…

Instead of having sns_topic_name as the parameter for the layer I would have sns_topic_arn. Then you avoid calls to boto3, and you can also simplify a bit the CF resources file. Also, since the SNS topic is not part of this application but something set up externally it makes more sense to use the ARN. What if the user wanted to send the notification to an SNS topic in another AWS region? Or in another AWS account?

I agree, it makes more sense passing the ARN.

Comments from Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants