To automate the report for EC2 instances

0

Hi AWS,

We are generating a report for EC2 instances and capturing details such as Instance ID, Instance Name, Instance State, IP Address, Applications running on the instance, and Provisioning status if the instance is overprovisioned, underprovisioned, optimized or None. Having said that right now we are doing this manually. But now the problem is if any instance has been terminated, stopped or any new instance will be spun in place of an existing instance with a different name I am not aware of this and it is a serious concern from production perspective. Is there a way where such event occurs there will be notification generated based on that and it will be automatically updated in the excel report considering the changes done.

This question is the extension of the following question https://repost.aws/questions/QUSvgJ_0rbRQS4pAOHpLCq9g/provisioning-ec2-instances-in-aws-account

Please guide.

profile picture
Arjun
asked 8 months ago251 views
1 Answer
1

Hi,

for your purpose, you can use EventBridge events that will notify you instantly of instance state changes: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitor-ami-events.html#ami-events

You have many other types of such events that you can leverage for your own use case: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/automating_with_eventbridge.html

On those events, you can

  • Invoke an AWS Lambda function
  • Invoke Amazon EC2 Run Command
  • Activate an AWS Step Functions state machine
  • Notify an Amazon SNS topic
  • Notify an Amazon SQS queue

to take the actions that you need: update the instance report in your case.

It's serverless; so minimal effort on your side to run such a system and high cost efficiency (pay-as-you-use)

Best,

Didier

profile pictureAWS
EXPERT
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions