Sitemap
SRIMAN R

SRIMAN R

DevOps

AWS Project Using Shell Scripting

2 min readMay 18, 2024
Press enter or click to view image in full size

Project Title - AWS Resource Tracker

Nowadays, many organizations use EC2 instances, S3 buckets, Lambda functions, and IAM for users. It's hard to track the usage of resources manually. This shell script helps to track AWS resources effectively. The AWS CLI fetches information about EC2 instances, S3 buckets, Lambda functions, and IAM users.

How to proceed?

  1. Install AWS CLI.
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"

unzip awscliv2.zip

sudo ./aws/install

OR

sudo snap install aws-cli --classic

2. Configure the AWS CLI with your AWS Access Key and Secret Key.

Press enter or click to view image in full size

3. Create a text file named "aws_resource_tracker.sh" using the VIM editor command and edit it with the script details.

Press enter or click to view image in full size

4. Modify the permission of "aws_resource_tracker.sh".

Press enter or click to view image in full size

5. Execute the script.

./aws_resource_tracker.sh

6. Output.

Press enter or click to view image in full size

Automate Using CRON JOB

Get SRIMAN R’s stories in your inbox

Join Medium for free to get updates from this writer.

We need to schedule this script to run at a particular time daily by using the CRON job.

  1. Create a CRON job
export VISUAL=vi
crontab -e

2. Schedule CRON job to run at 6 PM every day

0 18 * * * aws_resource_tracker.sh

If you found this article helpful, Follow me for more articles like this.

You can see this project on GitHub

You can connect me on LinkedIn
Thank You 🖤

--

--