Skip to content

Instantly share code, notes, and snippets.

View danielmacuare's full-sized avatar

Daniel Macuare danielmacuare

View GitHub Profile
@danielmacuare
danielmacuare / AWS-to-Slack.py
Last active September 14, 2020 14:52
AWS Lambda Function to Post an alert to a Slack channel every time Cloudwatch triggers the SNS-Backed Lambda
import logging
from json import dumps
from os import environ
from urllib3 import PoolManager
logging.getLogger().setLevel(logging.INFO)
def post_to_slack(event, context):
slack_channel = environ.get("SLACK_NET_CHANNEL")