forked from cattle-ops/terraform-aws-gitlab-runner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
49 lines (35 loc) · 1.14 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
48
data "aws_availability_zones" "available" {
state = "available"
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "2.5.0"
name = "vpc-${var.environment}"
cidr = "10.0.0.0/16"
azs = [data.aws_availability_zones.available.names[0]]
private_subnets = ["10.0.1.0/24"]
public_subnets = ["10.0.101.0/24"]
enable_nat_gateway = true
single_nat_gateway = true
enable_s3_endpoint = true
tags = {
Environment = var.environment
}
}
module "runner" {
source = "../../"
aws_region = var.aws_region
environment = var.environment
ssh_public_key = local_file.public_ssh_key.content
vpc_id = module.vpc.vpc_id
subnet_ids_gitlab_runner = module.vpc.private_subnets
subnet_id_runners = element(module.vpc.private_subnets, 0)
runners_name = var.runner_name
runners_gitlab_url = var.gitlab_url
runners_token = var.runner_token
runners_off_peak_timezone = var.timezone
runners_off_peak_idle_count = 0
runners_off_peak_idle_time = 60
# working 9 to 5 :)
runners_off_peak_periods = "[\"* * 0-9,17-23 * * mon-fri *\", \"* * * * * sat,sun *\"]"
}