This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import logging | |
import boto3 | |
from botocore.exceptions import ClientError | |
def setup_logger(log_level): | |
""" | |
Configures and returns a logger instance. | |
""" | |
logging.basicConfig( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import argparse | |
import os | |
import sys | |
import configparser | |
import logging | |
import shutil # newly added import | |
# Constants | |
ROLES = ["Admin", "GodMode", "ReadOnly"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////////////////////////////////////////////////////////////////////////////// | |
// BEGIN EDITS //////////////////////////////////////////////////////////////////////////////// | |
const TEMPLATE_FILE_ID = 'YOUR_TEMPLATE_FILE_ID_HERE'; | |
const DESTINATION_FOLDER_ID = 'YOUR_DESTINATION_FOLDER_ID_HERE'; | |
const CURRENCY_SIGN = 'Kr'; | |
// END EDITS ////////////////////////////////////////////////////////////////////////////////// | |
/////////////////////////////////////////////////////////////////////////////////////////////// | |
// WARNING: EDITING ANYTHING BELOW THIS LINE WILL CHANGE THE BEHAVIOR OF THE SCRIPT. ////////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"cloudtrail:LookupEvents", | |
"ec2:CreateTags", | |
"ec2:Describe*", | |
"logs:CreateLogGroup", | |
"logs:CreateLogStream", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Usage for a AWS test profile: | |
# python scriptname.py test | less | |
import boto3 | |
import botocore.session | |
import argparse | |
import json | |
# define some colors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import botocore | |
import datetime | |
import progressbar | |
import itertools | |
import argparse | |
# from https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html | |
STORAGE_TYPES = [ | |
"StandardStorage", |