This commit is contained in:
carnal0wnage
2018-04-07 19:37:29 -04:00
parent 5de3e23dc4
commit 7c368b9a62
3 changed files with 23 additions and 18 deletions

View File

@@ -1,11 +0,0 @@
'''
This file is used to perform some ElasticBeanstalk actions
'''
from libs.elasticbeanstalk import *
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
#describe_applications(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
#describe_application_versions(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
#describe_configuration_options(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
describe_environments(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
describe_events(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)

View File

@@ -4,13 +4,15 @@ EMR functions
import boto3
import botocore
import os
import pprint
import sys,os
import sys
pp = pprint.PrettyPrinter(indent=5, width=80)
#from http://docs.aws.amazon.com/general/latest/gr/rande.html
regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', ]
# from http://docs.aws.amazon.com/general/latest/gr/rande.html
regions = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', ]
def list_clusters(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
print("### Printing EMR Clusters ###")
@@ -20,7 +22,7 @@ def list_clusters(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
response = client.list_clusters()
#print response
# print response
if response.get('Clusters') is None:
print("{} likely does not have EMR permissions\n" .format(AWS_ACCESS_KEY_ID))
@@ -40,7 +42,8 @@ def list_clusters(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
else:
print("Unexpected error: {}" .format(e))
except KeyboardInterrupt:
print("CTRL-C received, exiting...")
print("CTRL-C received, exiting...")
def list_security_configurations(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
print("### Printing EMR Security Configuration ###")
@@ -50,7 +53,7 @@ def list_security_configurations(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
response = client.list_security_configurations()
#print response
# print response
if response.get('SecurityConfigurations') is None:
print("{} likely does not have EMR permissions\n" .format(AWS_ACCESS_KEY_ID))
@@ -70,4 +73,4 @@ def list_security_configurations(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY):
else:
print("Unexpected error: {}" .format(e))
except KeyboardInterrupt:
print("CTRL-C received, exiting...")
print("CTRL-C received, exiting...")

13
modules/emr.py Normal file
View File

@@ -0,0 +1,13 @@
'''
This file is used to perform some EMR actions
'''
from libs.emr import *
from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
def step_emr_list_clusters():
list_clusters(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
def step_emr_list_security_configurations():
list_security_configurations(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)