Skip to content

Instantly share code, notes, and snippets.

View rowanu's full-sized avatar

rowan rowanu

View GitHub Profile
@rowanu
rowanu / get-all-actions.py
Created October 12, 2024 04:13
Get all AWS IAM actions
import requests
import json
def fetch_json(url):
response = requests.get(url)
return response.json()
def main():
@rowanu
rowanu / all-deprecated-runtime-lambda-functions.sh
Last active March 22, 2024 00:03
All deprecated Lambda runtimes in an AWS account
aws lambda list-functions \
--output text \
--query 'Functions[?
Runtime!=`nodejs20.x` &&
Runtime!=`nodejs18.x` &&
Runtime!=`nodejs16.x` &&
Runtime!=`python3.12` &&
Runtime!=`python3.11` &&
Runtime!=`python3.10` &&
Runtime!=`python3.9` &&
@rowanu
rowanu / potentially-expensive-actions.json
Last active October 8, 2024 07:54 — forked from iann0036/gist:b473bbb3097c5f4c656ed3d07b4d2222
SCP to deny potentially expensive and/or long-running AWS IAM actions
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PotentiallyExpensiveActions",
"Effect": "Deny",
"Action": [
"acm-pca:CreateCertificateAuthority",
"aws-marketplace:AcceptAgreementApprovalRequest",
"aws-marketplace:Subscribe",
@rowanu
rowanu / codebuild.yaml
Created January 13, 2020 23:42
Invalidate CloudFront from CodePipeline
InvalidateCacheProject:
Type: AWS::CodeBuild::Project
Properties:
Artifacts:
Type: CODEPIPELINE
Environment:
ComputeType: BUILD_GENERAL1_SMALL
Image: aws/codebuild/standard:2.0
Type: LINUX_CONTAINER
Name: !Sub ${AWS::StackName}-invalidate-cache
@rowanu
rowanu / function-and-log-group.yaml
Last active March 19, 2021 12:38
Clean up a Lambda function's logs when you delete it
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
InlineCode: |
exports.handler = async () => {
@rowanu
rowanu / output.log
Created February 10, 2018 08:35
CodeBuild Output
[Container] 2018/02/10 08:28:22 Waiting for agent ping
[Container] 2018/02/10 08:28:25 Waiting for DOWNLOAD_SOURCE
[Container] 2018/02/10 08:28:31 Phase is DOWNLOAD_SOURCE
[Container] 2018/02/10 08:28:31 CODEBUILD_SRC_DIR=/codebuild/output/src210388559/src
[Container] 2018/02/10 08:28:31 YAML location is /codebuild/output/src210388559/src/buildspec.yaml
[Container] 2018/02/10 08:28:31 Processing environment variables
[Container] 2018/02/10 08:28:31 Moving to directory /codebuild/output/src210388559/src
[Container] 2018/02/10 08:28:31 Registering with agent
[Container] 2018/02/10 08:28:31 Phases found in YAML: 3
[Container] 2018/02/10 08:28:31 INSTALL: 3 commands
@rowanu
rowanu / updateSecurityGroup.js
Last active December 25, 2019 09:26
Update an AWS Security Group to allow access by a specific AWS service.
'use strict';
const AWS = require('aws-sdk');
const https = require('https');
const ec2 = new AWS.EC2();
const ipRangesUrl = 'https://ip-ranges.amazonaws.com/ip-ranges.json';
const target = {
port: 5432,
protocol: 'tcp',
@rowanu
rowanu / data.json
Last active July 25, 2021 05:44
Visualising EC2 Security Groups
[
{
"name": "AppName-AppServer-ASG-SG",
"id": "sg-b8ce4cc0",
"ingress": [
{
"name": "AppName-AppServer-ELB-SG",
"protocol": "tcp",
"fromPort": 8080
}
@rowanu
rowanu / README.md
Last active July 30, 2021 02:48
Hotness Widget for the Dashing dashboard from Shopify

Dashing Hotness Widget

Are you dashing? Are you hot? Then you need the Dashing Hotness Widget!

See the blog post for more details.

About

This widget is similar to the basic Number widget, except that the entire widget changes colour based on the value displayed. It is designed to draw attention to