Skip to content

Instantly share code, notes, and snippets.

View hankchanocd's full-sized avatar
😈
Mobilize the world with AI

Hank Chan hankchanocd

😈
Mobilize the world with AI
View GitHub Profile
@hankchanocd
hankchanocd / cloudwatch-sns-lambda-slack-alert.py
Last active December 9, 2020 14:22
EC2 State Alerts through SNS/Lambda to Slack
'''
Follow these steps to configure the webhook in Slack:
1. Navigate to https://<your-team-domain>.slack.com/services/new
2. Search for and select "Incoming WebHooks".
3. Choose the default channel where messages will be sent and click "Add Incoming WebHooks Integration".
4. Copy the webhook URL from the setup instructions and use it in the next section.
@hankchanocd
hankchanocd / aws_cloudfront_deploy.yml
Last active December 9, 2020 14:22
GH Actions to Deploy Jekyll Site to S3
name: Deploy Jekyll Site to S3
on: [push]
jobs:
run:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@hankchanocd
hankchanocd / netlify-function-sends-slack-notifications.js
Last active April 8, 2024 19:22
Netlify Function Sends Slack Notifications
/*
Since late 2020, Netlify has put up a pay wall on its built-in Slack notifications for CI/CD.
This gist shows you a workaround using the still-free Netlify's deploy webhook that triggers a Netlify Function calling Slack Incoming Webhook.
Steps:
1. Deploy this Netlify Function
2. Have the corresponding link pasted into Netlify's deploy webhook, i.e. https://example.com/.netlify/functions/<your-function>
3. In next deploy, Netlify will trigger the deploy webhook, which in turn calls your Slack Incoming Webhook
*/