-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.tf
40 lines (33 loc) · 1022 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
####### Please use terraform version v0.12 ###############
module "stop_ec2_instance" {
source = "./lambda-scheduler-stop-start/"
name = "ec2_stop"
cloudwatch_schedule_expression = "cron(30 16 ? * MON-FRI *)"
schedule_action = "stop"
ec2_schedule = "true"
resources_tag = {
key = "schedule"
value = "yes"
}
tags = {
environment = "nonprod"
techteam = "TeamA"
role = "lambda"
}
}
module "start_ec2_instance" {
source = "./lambda-scheduler-stop-start/"
name = "ec2_start"
cloudwatch_schedule_expression = "cron(0 4 ? * MON-FRI *)"
schedule_action = "start"
ec2_schedule = "true"
resources_tag = {
key = "schedule"
value = "yes"
}
tags = {
environment = "nonprod"
techteam = "TeamA"
role = "lambda"
}
}