I want an alarm to operate only overnight between 18:00 and 08:00 so I can keep an EC2 instance running all the working day and stop overnight if no-one is using it. Is this possible?
Disable AWS Cloudwatch alarm during normal working hours
2.2k Views Asked by N Burnett At
2
There are 2 best solutions below
0
x89
On
You can automate this by creating an EventBridge rule where you specify a cron or schedule expression that runs a Python lambda function on specific timings.
Then, you can use your Lambda function to enable or disable an alarm(s) according to your required schedules.
disable_alarm = client.disable_alarm_actions(AlarmNames=alarm_names)
Here's a good tutorial: https://medium.com/geekculture/terraform-structure-for-enabling-disabling-alarms-in-batches-5c4f165a8db7
Related Questions in AMAZON-EC2
- Using HDFS with Apache Spark on Amazon EC2
- How can I access Mule ESB Community edition via browser?
- AWS EC2: Migrating from Windows to Linux Server
- AWS Flow Framework: Can we run activity worker and activity task on different EC2 instances
- How to fix WordPress HTTPS issues when behind an Amazon Load Balancer?
- Determine Deployment Group from appspec.yml
- easy_install does not configure SimpleITK properly
- Bad Request (400) while hosting osqa to AWS EC2
- AWS CLI for EBS snapshots
- test-kitchen: how to read platform specific attributes in kitchen.yml
- Best way to store shared files between ec2 instances
- WebSocket connection failed: WebSocket opening handshake was canceled
- Rails scheduled task behind a load balancer
- Install google mod- pagespeed on elastic beanstalk on every instance added
- ELB generating 504 GATEWAY_TIMEOUTS w/ 2 EC2 instances - Packets not reaching Servers
Related Questions in ALARM
- How to achieve AlarmApplicationManager AlarmAccessStatus as AllowedWithWakeupCapability?
- Android repeating alarm not repeating correctly
- Dismiss Windows Phone alarm
- How to create an alarm clock app with swift?
- Repeating background tasks in Android
- iOS - How can I schedule something once a day?
- How to use Android studio Ringtonemanager.TYPE_RINGTONE
- Alternatives for AlarmManager setRepeating in API 19 and above?
- What's the return value of alarm() if there is already an alarm being set
- Setting Notification using AlarmManager by passing calendar.getTimeInMillis(),triggers notification instantly not at the time intended
- Interrupt a process calling the function popen
- Repeating alarm stops working
- Android native alarm application sound files: Download and reuse
- Android service for alarms
- How to Call multiple methods on a single button click in android ?`
Related Questions in AMAZON-CLOUDWATCH
- Are earlier historical metrics published to CloudWatch Delayed?
- A sane way to set up CloudWatch logs (awslogs-agent)
- aws cloudwatch metric overwrite/override
- Cloudwatch Agent errors with: No option 'file' in section: 'loggers'
- Dynamically create cronjobs in AWS
- Cloudwatch boto3 put_log_events giving incorrect return
- Monitoring memory usage in AWS CloudWatch for Windows instance
- AWS - Using CloudWatch to trigger script on ec2 instance
- Checking if process runtime with AWS Cloudwatch
- How to pass map to AWS cloudwatch
- Unable to monitor Free Disk Space for Windows Instances using Custom CloudWatch Metrics
- Monitoring Memory Usage for multiple EC2 instances
- How can we monitor a process with cloudwatch
- Wrong event time in CloudWatch log events
- Unable to push Server Work Queue Length custom metric to Cloud Watch
Related Questions in CLOUDWATCH
- Wrong event time in CloudWatch log events
- Cloudwatch alarm: "cb9978ge CPUUtilization"
- Disable AWS Cloudwatch alarm during normal working hours
- how to create custom metrics in AWS ec2 for monitoring memory utilization of an instance
- Monitoring Datomic in CloudWatch without CloudFormation
- AWS ElasticBeanstalk and AWS CloudWatch
- Cloud watch custom metrics creation with C# (.net) possible or not?
- How to use the nextToken in the ListMetrics function
- Can I monitor the usage of individual directories with AWS CloudWatch?
- Get AWS Auto Scaling Group metrics in cloudwatch
- AWS cloudwatch + logs = always in alarm status
- AWS CloudWatch alarm: Trigger when RDS instance is available but not used
- How to read the AWS Status Check Alarm message with Boto
- Aws cloudwatch get.metrics with more than one dimension
- Cloudwatch data logs to create a custom dashboard
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Of course this is possible but you need to write your own script to imitate this scenario, there are ec2-api's available which will help you make this happen.
What you can do:
nperiod.Hope this helps.