-
Notifications
You must be signed in to change notification settings - Fork 0
/
batch.tf
49 lines (35 loc) · 1.1 KB
/
batch.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
49
resource "aws_batch_compute_environment" "nextflow" {
compute_environment_name = "${local.common_tags.Name}"
compute_resources {
instance_role = aws_iam_instance_profile.ecs_instance.arn
allocation_strategy = "BEST_FIT"
instance_type = var.instance_type_choices
ec2_configuration {
image_id_override = var.ami_id
image_type = "ECS_AL2"
}
max_vcpus = var.max_vcpus
min_vcpus = 0
security_group_ids = [
aws_security_group.batch.id
]
subnets = [
aws_subnet.private.id
]
type = "EC2"
}
service_role = aws_iam_role.aws_batch_service.arn
type = "MANAGED"
state = "ENABLED"
# For preventing race condition during deletion. See:
# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/batch_compute_environment
depends_on = [aws_iam_role_policy_attachment.batch_service]
}
resource "aws_batch_job_queue" "default" {
name = "${local.common_tags.Name}-queue"
state = "ENABLED"
priority = 1
compute_environments = [
aws_batch_compute_environment.nextflow.arn,
]
}