https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/awscli/examples/events/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/awscli/examples/events/put-rule.rst
**To create CloudWatch Events rules**

This example creates a rule that triggers every day at 9:00am (UTC).  If you use put-targets to add a Lambda function as a target of this rule, you could run the Lambda function every day at the specified time::

  aws events put-rule --name "DailyLambdaFunction" --schedule-expression "cron(0 9 * * ? *)"     

This example creates a rule that triggers when any EC2 instance in the region changes state::

  aws events put-rule --name "EC2InstanceStateChanges" --event-pattern "{\"source\":[\"aws.ec2\"],\"detail-type\":[\"EC2 Instance State-change Notification\"]}"  --role-arn "arn:aws:iam::123456789012:role/MyRoleForThisRule"

This example creates a rule that triggers when any EC2 instance in the region is stopped or terminated::

  aws events put-rule --name "EC2InstanceStateChangeStopOrTerminate" --event-pattern "{\"source\":[\"aws.ec2\"],\"detail-type\":[\"EC2 Instance State-change Notification\"],\"detail\":{\"state\":[\"stopped\",\"terminated\"]}}" --role-arn "arn:aws:iam::123456789012:role/MyRoleForThisRule" 

https://t.me/RX1948 - 2025