#!/usr/bin/python3.6
# CUSTOM LAMBDA FUNCTION

import json
import os

import urllib3

http = urllib3.PoolManager()


def lambda_handler(event, context):
    url = os.environ["SLACK_WEBHOOK_URL"]
    msg = {
        "channel": "#channel-name",
        "username": "Prometheus",
        "text": event["Records"][0]["Sns"]["Message"],
        "icon_emoji": "",
    }

    encoded_msg = json.dumps(msg).encode("utf-8")
    resp = http.request("POST", url, body=encoded_msg)
    print(
        {
            "message": event["Records"][0]["Sns"]["Message"],
            "status_code": resp.status,
            "response": resp.data,
        }
    )

90c7835bebc1d0a63c1bc93c26c32ecccebd506c
<mask token>

<mask token>


def lambda_handler(event, context):
    url = os.environ['SLACK_WEBHOOK_URL']
    msg = {'channel': '#channel-name', 'username': 'Prometheus', 'text':
        event['Records'][0]['Sns']['Message'], 'icon_emoji': ''}
    encoded_msg = json.dumps(msg).encode('utf-8')
    resp = http.request('POST', url, body=encoded_msg)
    print({'message': event['Records'][0]['Sns']['Message'], 'status_code':
        resp.status, 'response': resp.data})

<mask token>
http = urllib3.PoolManager()


def lambda_handler(event, context):
    url = os.environ['SLACK_WEBHOOK_URL']
    msg = {'channel': '#channel-name', 'username': 'Prometheus', 'text':
        event['Records'][0]['Sns']['Message'], 'icon_emoji': ''}
    encoded_msg = json.dumps(msg).encode('utf-8')
    resp = http.request('POST', url, body=encoded_msg)
    print({'message': event['Records'][0]['Sns']['Message'], 'status_code':
        resp.status, 'response': resp.data})

import json
import os
import urllib3
http = urllib3.PoolManager()


def lambda_handler(event, context):
    url = os.environ['SLACK_WEBHOOK_URL']
    msg = {'channel': '#channel-name', 'username': 'Prometheus', 'text':
        event['Records'][0]['Sns']['Message'], 'icon_emoji': ''}
    encoded_msg = json.dumps(msg).encode('utf-8')
    resp = http.request('POST', url, body=encoded_msg)
    print({'message': event['Records'][0]['Sns']['Message'], 'status_code':
        resp.status, 'response': resp.data})

#!/usr/bin/python3.6
# CUSTOM LAMBDA FUNCTION

import json
import os

import urllib3

http = urllib3.PoolManager()


def lambda_handler(event, context):
    url = os.environ["SLACK_WEBHOOK_URL"]
    msg = {
        "channel": "#channel-name",
        "username": "Prometheus",
        "text": event["Records"][0]["Sns"]["Message"],
        "icon_emoji": "",
    }

    encoded_msg = json.dumps(msg).encode("utf-8")
    resp = http.request("POST", url, body=encoded_msg)
    print(
        {
            "message": event["Records"][0]["Sns"]["Message"],
            "status_code": resp.status,
            "response": resp.data,
        }
    )
