I was trying to get a notification, it doesn’t matter how as though via email, sms, etc. The notification shouldn’t be for state-changes only, which I have already done. Instead, I’d like to be notified when a EIP is disassociated, either network interface or volume is detached, or something bearing on affecting the Ec2 itself.
Is this possible?
I have been working with Amazon EventBridge rules, but I only get captured when is stopped, terminated or running.
2
Answers
So, I figured it out as you said it @paolo. Basically, I have looked for the event on CloudTrail, and match it on Eventbridge; however, I had to do all the Event Patterns separately as follows to make them work.
For the detach network which is attach to the instance I want to monitor:
And for the instance status
And so on for AIM roles, DetachVolumes, ModifyNetworkInterface, etc.
If you want to be notified of a specific event, such as when an EIP is disassociated, I would recommend you use EventBridge with a CloudTrail pattern (in this case, for the
DisassociateAddress
event).If you want to be notified of any changes to the EC2 instance, I would recommend you use Config.