For an AWS Security Group to be considered in-use/active it will be assigned to an Elastic network interface (ENI's).
The following Python script will determine currently unused security groups by:
- Query AWS for all active ENI's in an account region.
- For each interface, extract the attached security group(s).
- Query AWS for all security groups within the same account region.
- Determine where and output a security group which currently has zero assignments to any active ENI's.
A quick-and-dirty browser script for extracting action list tables from AWS Identity and Access Management pages to JSON documents.
Once in JSON, these IAM action lists can be easily queried using tools such as jq
to answer questions such as:
- List all
Write
IAM actions for service X. - List all
Read
IAM actions for service X resource type Y.
This query can be handy for tasks such as setting up a logical replication publication, where by default a table's PRIMARY KEY
is used to identify subscriber side rows for update or delete.
By locating tables without a PRIMARY KEY
(tisk!), we're able to either update the table schema, or use an alternative replica identity type.
SELECT tbl.table_catalog,tbl.table_schema,tbl.table_name
FROM information_schema.tables tbl
WHERE
Simple HTTP server, listening on localhost:8083
which just echoes back HTTP requets sent to it.
Blantant ripoff of: https://gist.github.com/bszwej/62c327d773051816ed4949fd40c82c74
Quick way to delete all existing build history from AWS CodeBuild using the AWS CLI.
#!/bin/bash -e
buffer=()
for buildId in $(aws codebuild list-builds --query 'ids.join(`\n`,@)' --output text); do
buffer+=($buildId)
Bash script to install the latest released version of the AWS CLI v2 from the distrubuted source.
Using this method to exectue the CLI under a MacBook M1 laptop as a native ARM binary - rather than falling back to Rosetta. Currently the offically packaged macOS .pkg
doesn't support both Intel/M1 architectures.
Script designed to be re-run - will blow away an existing install and re-install the latest available version.
Note
This install script assumes you have installed a suitable version of Python 3 - has been tested against:
Small Bash script, calling curl
with the --aws-sigv4
option to AWS V4 sign a given request for use with an IAM authorized API Gateway endpoint.
./aws-api-gateway-iam.sh \
--request GET \
"https://api-gateway.mydomain.com/this/route/aws-iam-authz"
> [!NOTE]
> Note.