-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
47 lines (42 loc) · 1.33 KB
/
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
41
42
43
44
45
46
47
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.32"
}
}
required_version = ">= 1.2.0"
}
provider "aws" {
region = "eu-central-1"
}
module "shared-resources" {
source = "./modules/shared-resources"
scheduler_group_name = var.scheduler_group_name
}
module "workday_start" {
source = "./modules/schedule"
scheduler_name = "workday-start"
scheduler_group_name = var.scheduler_group_name
schedule_expression = "cron(00 9 ? * 2-6 *)"
scheduler_target_arn = module.shared-resources.start_stop_lambda_function_arn
scheduler_target_role_arn = module.shared-resources.scheduler_execution_role_arn
scheduler_target_input = jsonencode({
start = true
tag_name = "scheduler"
tag_value = "dev"
})
}
module "everyday_stop" {
source = "./modules/schedule"
scheduler_name = "everyday-stop"
scheduler_group_name = var.scheduler_group_name
schedule_expression = "cron(00 22 * * ? *)"
scheduler_target_arn = module.shared-resources.start_stop_lambda_function_arn
scheduler_target_role_arn = module.shared-resources.scheduler_execution_role_arn
scheduler_target_input = jsonencode({
start = false
tag_name = "scheduler"
tag_value = "dev"
})
}