Skip to content

Commit

Permalink
AWS 1 : added AWS menu and AWS Config features
Browse files Browse the repository at this point in the history
  • Loading branch information
gaius-r committed Nov 5, 2020
1 parent 3d8d898 commit 6f208fb
Showing 1 changed file with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions menu.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,52 @@
# ARTH TASK - Python scripting for all Technologies learnt
# Try to keep the code as neat as possible for easy understanding of changes and control flow

import os

loginAWS = False
profiles = []

# function to launch AWS instances
def lcaws():
def launchInstance():
print("Press ")


return

def awsConfigure():
global loginAWS

print("\nAWS Configure\n-----------\n")

name = input("Enter name of profile : ")
print("Region name for Mumbai AZ : ap-south-1 | Leave default output format blank for JSON")
os.system("aws configure --profile {}".format(name))
profiles.append(name)
loginAWS = True
return

def awsMenu():
print('\n')
os.system('aws --version')

while True:
if not loginAWS:
awsConfigure()
else:
choice = input("\n1. Launch instance\t2. AWS Configure\t3. List Profiles\t4. Exit\n> ")
if choice == '1':
launchInstance()
elif choice == '2':
awsConfigure()
elif choice == '3':
os.system("aws configure list-profiles")
elif choice == '4':
break
else:
print("Invalid choice!!! Choose from 1-3\n")
return



# function to launch Hadoop cluster
def lchadoop():
Expand All @@ -31,10 +73,10 @@ def simml():
# Based on added menu options, create functions too with additional elif statements.
print("1. Launch AWS Instance\t 2. Launch Hadoop Cluster\t3. Launch Docker Containers\n4. Simulate ML Model\n")
print("Press Q to quit.\n")
choice = raw_input("Enter your choice : ")
choice = input("> ")

if choice == '1':
lcaws()
awsMenu()
elif choice == '2':
lchadoop()
elif choice == '3':
Expand Down

0 comments on commit 6f208fb

Please sign in to comment.