diff --git a/elasticbeanstalk_describe.py b/elasticbeanstalk_describe.py deleted file mode 100644 index dcd9e1e..0000000 --- a/elasticbeanstalk_describe.py +++ /dev/null @@ -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) diff --git a/libs/emr.py b/libs/emr.py index 983bd4c..dfc42ed 100644 --- a/libs/emr.py +++ b/libs/emr.py @@ -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...") diff --git a/modules/emr.py b/modules/emr.py new file mode 100644 index 0000000..ddb6a99 --- /dev/null +++ b/modules/emr.py @@ -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)