Skip to content

Instantly share code, notes, and snippets.

View shashank-1729's full-sized avatar
🎯
Focusing

shashank-1729

🎯
Focusing
View GitHub Profile
@shashank-1729
shashank-1729 / PY0101EN-2-3-Sets.ipynb
Created April 15, 2021 06:35
Created on Skills Network Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonrau1
jonrau1 / AWS_CrossAccount_CrossRegion_Multiprocessing.py
Created February 28, 2021 15:42
This Python script provides a mechanism to retrieve all AWS Accounts from AWS Organizations and get all opted-in Regions from the EC2 DescribeRegions API and provide them to STS and Boto3 Sessions to create multiple thread-safe Boto3 Clients for the purpose of parallelized asset collection in your entire AWS Organization. This also provides a wa…
import os # For environmental variables when running in CodeBuild, Fargate, Lambda, etc.
import boto3 # Because you need it lol
import botocore # For Error Handling
import json # To parse "stringified" JSON Policy documents
import time # to create Unix timestamps for DynamoDB TTL
import multiprocessing
import hashlib # To create unique IDs for places where AWS doesn't have them
from botocore.config import Config
# Boto3 Client Configuration for retries. AWS Defaults to 4 Max Attempts in "Normal Mode"