This file contains 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
#Step 1: Get a list of all alarms in INSUFFICIENT_DATA status | |
#Step 2: Get a list of all instances (stopped and started) | |
#Step 3: Find all alarms on instances that don't exist, and delete them | |
################################################### | |
#Step 1: Get alarms in INSUFFICENT_DATA state | |
################################################### | |
#The max that we can get per loop is 100; all alarms for nonexistent instances will be in | |
#INSUFFICIENT_DATA state so let's just go through those. | |
insuff_alarms = [] | |
loops = 1 |
This file contains 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/env python | |
#inventory a bucket | |
import boto3 | |
import re | |
import os | |
import logging | |
import random | |
from random import choice | |
from string import ascii_uppercase |
This file contains 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/env python | |
#inventory of all multipart uploads in a region | |
import boto3 | |
import os | |
#Not sure this applies here but keeping just in case | |
region = "us-east-1" | |
#The profile to use in the credentials or boto.config file, if used | |
profile_nm = 'foo' |
This file contains 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
for user in iam.users.all(): | |
# Nothing is initially loaded | |
profile = user.LoginProfile() | |
try: | |
profile.load() | |
# We don't care if this works | |
except ClientError as e: | |
if 'NoSuchEntity' in e.response['Error']['Code']: | |
nm = user.name | |
#print(nm,"is a service account.") |