Evaluating bids

Python/Boto3 com Aws

Published on the October 29, 2019 in IT & Programming

About this project

Open

Write a program to automate and manage a AWS cloud services. Use the Boto3 package to interact with AWS cloud services. Use free tier on AWS in all cases.



Requirements:
1. The program will initially prompt the user for a username and password to login to the system. Valid usernames and passwords are to be stored in a file called “passwd.txt”, each line of which will contain a username+password pair, and their AWS access key id and secret access key, all separated by tabs.

e.g. The content of a sample “passwd.txt” may be:
David 12345pass AKIKAOD798 PPB7952+AmaYUd+824nmW
John aaaaaaaaa AKOP67NKAF CpA9752SDF+709+fa09faAfG
Joan bcbcbcddddddd AIL67NK8NM KMALF75+95mml+7+89052

If the user provides an incorrect username and/or password, issue an appropriate error message and loop, prompting for login credentials again. If the user provides an empty/blank username, exit the program.

2. After providing valid login credentials, the program will use the aws access key id and secret key associated with that login to form the connection to aws. Then, the program will present the user with a Python command-line text-based menu for managing AWS. This will direct the user to subsequent submenus outlined below.

A back option should be provided to allow the user to easily navigate the menus and to choose another service after an initial choice. There should also be an option to exit the menus and end the program. Ease of use should be taken into account when designing the menu system.



- EC2 Instances
o List all instances for the AWS account. Separately display the running instances from the others. (i.e.

Display the running instances first, then display all the other instances afterwards). For each instance, show the state, the ami id, instance type, region the instance is deployed in and the time it was launched (example screenshot provided) if running.
O Start a specific instance (prompt user for the instance ID, from a list)
o Stop a specific instance (prompt user for the instance ID, from a list)
o Create an AMI from an existing Instance (prompt for instance ID, from a list)
o Launch a new instance from an existing (free tier) AMI (Be very careful here that you are not starting any instances that will cost you money).

This method should prompt the user to enter either “windows” or “linux” depending on the free tier usage OS they wish to deploy. Assume all instances will be deployed in the EU West 1 region.

- EBS Storage
o List all volumes
o Attach an existing volume to an instance
o Detach a volume from an instance
o Take a snapshot of a specific volume
o Create a volume from a snapshot

- S3 Storage
o List all buckets
o List all objects in a bucket (Allow users to choose from a list of buckets or enter a bucket name)
o Upload an object
o Download an object (make it easy to select from the existing objects)
o Delete an object

- Monitoring
o Display 2 performance metrics (of your choice) gathered for a particular EC2 instance (Prompt the user for the EC2 instance in question), averaged over the last 10minutes.
O Set an alarm such that if the CPU utilization is less than 35% an alarm will be raised. When an alarm is raised, use the aws sns to send a notification to an email account.

The user should be able to specify the email address as a menu option at the command line.
O Choose from one of the following free tier Amazon services. Describe what it does (in a comment in the python script) and provide a detailed example of how you can manipulate it using boto3 (give 4 short example functions).


 Autoscaling
 AmazonDB
 Relational DB Service
 Elastic Load Balancing

3. You should use a boto3 “Waiter” in at least 1 of the operations which does not complete immediately (e.g. Starting an instance, creating a volume from snapshot, etc.

), And provide output telling the user to wait until the operation completes, then permit the user to resume navigating the menu after it completes.

4. Provide a ReadMe document which includes a description of the program (menu layout, etc.) And any necessary requirements/details for running the script (e.g. What subdirectory to place “passwd.txt” file in, if not in the main directory). The ReadMe should specify which file to run to open the main menu.
Importantly, please note that you should use best practice when writing your code i.e.

Use classes/methods where sensible, minimise hardcoding paths, and minimising code duplication. Code should be robust and include error checking so it can deal accordingly with error messages (e.g. If an operation requires that an instance be shut down first, it should not cause the program to crash if we try to run the operation on an active instance).



The code must include clear concise comments, for functions and also for any complex parts of code which explain what they are doing. i.e. What type of objects you’re working with, why you’re calling a method with certain arguments etc...

Category IT & Programming
Subcategory Web development
What is the scope of the project? Create a new custom site
Is this a project or a position? Project
I currently have I have specifications
Required availability As needed
API Integrations Cloud Storage (Dropbox, Google Drive, etc.)
Roles needed Developer

Delivery term: Not specified

Skills needed