-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
33 lines (29 loc) · 1017 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
provider "aws" {
region = "eu-west-1"
shared_credentials_file = "~/.aws/credentials"
profile = "beancrunch"
}
module "my-eks-cluster" {
source = "../../modules/my-eks-cluster"
vpc-public-subnet-default="dev-vpc-public-eu-west-1a"
vpc-name="dev-vpc"
env-tag="dev"
aws_credenital_profile="beancrunch"
}
resource "aws_autoscaling_schedule" "evening-stop" {
count = 2
scheduled_action_name = "asg-evening-stop-schedule.${count.index}"
min_size = "0"
max_size = "0"
desired_capacity = "0"
recurrence = "0 19 * * *"
autoscaling_group_name = "${module.my-eks-cluster.workers_asg_names[count.index]}"
}
resource "aws_autoscaling_schedule" "morning-start" {
scheduled_action_name = "asg-morning-start-schedule"
min_size = "1"
max_size = "5"
desired_capacity = "1"
recurrence = "0 8 * * MON-FRI"
autoscaling_group_name = "${module.my-eks-cluster.workers_asg_names[1]}"
}