Skip to content

Instantly share code, notes, and snippets.

View reecestart's full-sized avatar
💻

Reece reecestart

💻
View GitHub Profile
@reecestart
reecestart / set-iam-password-policy.sh
Created July 20, 2018 02:43
Set AWS IAM Password Policy to clear Trusted Advisor Check
aws iam update-account-password-policy --minimum-password-length 8 --require-numbers --require-uppercase-characters --require-lowercase-characters --require-symbols
@reecestart
reecestart / getAvailableIPs.py
Last active November 15, 2022 14:25
Checks all Subnets in all Regions for those with less than 20 available IP addresses
import boto3
# Define the connection
client = boto3.client('ec2')
# Get all Regions
response = client.describe_regions()
# Create an Array for Region Names
RegionNames = []
@reecestart
reecestart / set-intelligent-lifecycle.py
Created December 3, 2018 05:08
Gets all S3 Buckets and creates an Intelligent Tiering Lifecycle Rule on all of them.
import boto3
from datetime import date
from datetime import datetime
today = date.today()
today = datetime.combine(today, datetime.min.time())
client = boto3.client('s3')
# Get all buckets
response = client.list_buckets()
@reecestart
reecestart / getInstanceTypesAvailable.py
Created December 20, 2018 01:33
Output a CSV of Instance Types available for Launch for each AZ in a given AWS Region
import boto3
from botocore.exceptions import ClientError
class bcolors:
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
pricingclient = boto3.client('pricing', region_name='us-east-1')
@reecestart
reecestart / kmsKeyPolicyforCloudTrailOrganizations.json
Created January 9, 2019 00:04
Default KMS Key Policy for CloudTrail for AWS Organization
{
"Version": "2012-10-17",
"Id": "Key policy created by CloudTrail",
"Statement": [
{
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::012345678901:root",
@reecestart
reecestart / s3BucketPolicyCloudTrailOrganizations.json
Created January 9, 2019 01:44
Default S3 Bucket Policy for CloudTrail for AWS Organizations
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AWSCloudTrailAclCheck20150319",
"Effect": "Allow",
"Principal": {
"Service": "cloudtrail.amazonaws.com"
},
"Action": "s3:GetBucketAcl",

Keybase proof

I hereby claim:

  • I am reecestart on github.
  • I am reecestart (https://keybase.io/reecestart) on keybase.
  • I have a public key ASD96G7e5AWoI7kYirqOOtSoOTvm4lH1AMO_tC2Poky-qQo

To claim this, I am signing this object:

@reecestart
reecestart / getInstanceStoreForEachEC2InstanceType.py
Created February 13, 2019 06:09
Python script which uses the Pricing API to get the Instance Store details for each EC2 Instance Type
import ast
import boto3
from botocore.exceptions import ClientError
pricingclient = boto3.client('pricing', region_name='us-east-1')
paginator = pricingclient.get_paginator('get_attribute_values')
response_iterator = paginator.paginate(
ServiceCode='AmazonEC2',
@reecestart
reecestart / simpleDBCreateListDeleteDomains.md
Last active March 13, 2019 03:57
Create, List and Delete SimpleDB Domains with Python

Create, List and Delete SimpleDB Domains with Python

simpleDBCreateListDeleteDomains.py

@reecestart
reecestart / healthdemo.md
Last active November 20, 2019 16:57
List all Personal Health Dashboard events in all regions and get affected entities with Python

List all Personal Health Dashboard events in all regions and get affected entities with Python

healthdemo.py