Created
April 15, 2020 06:36
-
-
Save wshihadeh/56c18df2c9befb43059080c00562c9f4 to your computer and use it in GitHub Desktop.
aws_cloudwatch_event_rule
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_cloudwatch_event_rule" "ec2_stop_rule" { | |
name = "StopEC2Instances" | |
description = "Stop EC2 nodes at 19:00 from Monday to friday" | |
schedule_expression = "cron(0 19 ? * 2-6 *)" | |
} | |
resource "aws_cloudwatch_event_target" "ec2_stop_rule_target" { | |
rule = "${aws_cloudwatch_event_rule.ec2_stop_rule.name}" | |
arn = "${aws_lambda_function.stop_ec2_lambda.arn}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment