Amazon Web Services(AWS)-Terminal User Interface App-Part2

Photo by Christopher Gower on Unsplash

Project Structure:

AWS-TUI File Structure
$ python3 aws_run.py

AWS S3 Services:

S3 directory contains the file s3_services.py. This file provides lots of useful functions to work with S3 service.

  • Create New Bucket: createNewBucket function provides the option to create a new S3 bucket. It accepts bucket name(bucket name should be unique in the entire region), region-name, and constraint name as an input.
AWS-TUI: Three Buckets Initially
AWS-TUI: Creating a New Bucket
AWS-TUI: New Bucket is Created
  • Upload File to Bucket: uploadFileToBucket function provides a way to upload a new file to the S3 bucket. It accepts local file location, location inside S3 where we want to upload the file and ACL.
AWS-TUI: Uploading File To The Bucket
AWS-TUI: File Is Uploaded
  • Delete File from Bucket: By using the deleteFileFromBucket function, we can delete the file from the S3 bucket. This function accepts the file path inside the S3 bucket as an input.
  • Delete Bucket: This function has two sub-functions. To delete the empty bucket and the non-empty bucket.
  • Empty Bucket: This function will remove all of the objects from the bucket.
AWS-TUI: Removing All Files From Bucket And Deleting The Bucket
AWS-TUI: Bucket Is Deleted
  • Get List of Files: By using getListOfFiles function, we can display a list of all files stored inside the S3 bucket.
  • Get Bucket Access Control List: This function will return the access control list(ACL) of a bucket.
AWS-TUI: Getting List of Bucket Files And Getting Bucket ACL
  • Put Bucket Access Control List: Sets the permissions on an existing bucket using access control lists (ACL). In this app, there are two methods provided to put bucket ACL. I. Put Bucket ACL by ID. II. Put Bucket ACL by Email. Using email addresses to specify a grantee is only supported in the limited AWS Regions.
  • Get Object Access Control List: Returns the access control list (ACL) of an object. To use this operation, you must have READ_ACP access to the object.
AWS-TUI: Getting Object ACL
  • Put Object Access Control List: Uses the ACL subresource to set the access control list (ACL) permissions for an object that already exists in a bucket. You must have WRITE_ACP permission to set the ACL of an object. In this app, there are two methods provided to put object ACL. I. Put Object ACL by ID. II. Put Object ACL by Email. Using email addresses to specify a grantee is only supported in the limited AWS Regions.

AWS CloudTrail Servcies:

This service is so powerful and very useful in monitoring that, whatever we do on the cloud, it keeps all of the records(logs). These records are known as events. CloudTrail has all of the logs such as who logged in, who entered the wrong password, who terminated the instance, etc.

  • Get All Event Logs: This function gives us all of the event logs.
AWS-TUI: Getting ALl Event Logs
  • Get Last Event Log: By using the use of this function, we can get all of the details of the last event performed on the cloud.
AWS-TUI: Getting the Last Event Logs
  • Create Trail: Create-Trail used to integrate S3 with CloudTrail. This function creates a trail and stores all of the event details in the S3 bucket.
AWS-TUI: Creating New Trail
AWS-TUI: New Trail Is Created
  • Get Trail Details: Returns all of the details of the trails like trail name, name of the used S3 bucket, etc.
AWS-TUI: Get All Of The Trail Details
  • Get Required Trail Details: Returns the trail details that we choose to display. Sometimes, we don’t want all of the trail details. At that time, to get the required details, we can use this option.
  • Delete Trail: Removes the specified trail permanently.
AWS-TUI: Getting Required Trail Details and Deleting The Trail

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store