Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
302 views
in Technique[技术] by (71.8m points)

amazon web services - how to pass ssm parameter to cloudwatch to monitor ec2 instance state change?

is it possible to pass EC2 instance-id stored as a parameter in SSM to Cloud-Watch event rule.

EC2 will created by AutoScaling and its Instance-Id will be stored in SSM. Now I wanted to pass my SSM parameter to CloudWatch to monitor state change of the instance , in place of InstanceId as shown below.

enter image description here

question from:https://stackoverflow.com/questions/65645486/how-to-pass-ssm-parameter-to-cloudwatch-to-monitor-ec2-instance-state-change

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

No, there is no direct integration between Cloudwatch Event Rules and the SSM Parameter Store.

You'll have to build some automation to update the rule yourself. The goto solution for this would be a Lambda function that responds to changes in the parameter value and then updates the rule with the value. To trigger this you should be able to use an advanced parameter and use event bridge to trigger the lambda on parameter value changes.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...