Using Console
{ $.eventSource = "iam.amazonaws.com" && $.eventName = "AttachRolePolicy" }
.IAMPolicyChangesEventCount
.Using CLI
"YOUR_LOG_GROUP_NAME"
with the name of your CloudTrail log group.
put-metric-alarm
command to create an alarm based on the metric you created.
Using Python
"YOUR_LOG_GROUP_NAME"
with the name of your CloudTrail log group.These steps should help you set up the IAMPolicyChangesEventCount
metric in CloudWatch using the AWS Console, AWS CLI, or Python script. Remember to adjust the configuration according to your specific use case and environment.