forked from usegalaxy-eu/infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstance_core_celery.tf
38 lines (32 loc) · 1015 Bytes
/
instance_core_celery.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
variable "celery-count" {
default = 1
}
data "openstack_images_image_v2" "celery-image" {
name = "generic-rockylinux8-v60-j168-5333625af7b2-main"
}
resource "openstack_compute_instance_v2" "celery" {
name = "celery-${count.index}.galaxyproject.eu"
image_id = data.openstack_images_image_v2.celery-image.id
flavor_name = "c1.c36m100"
key_pair = "cloud2"
tags = []
security_groups = ["default", "ingress-from-proxy"]
network {
name = "bioinf"
}
user_data = <<-EOF
#cloud-config
package_update: true
package_upgrade: true
EOF
count = var.celery-count
}
resource "aws_route53_record" "celery-galaxyproject" {
allow_overwrite = true
zone_id = var.zone_galaxyproject_eu
name = "celery-${count.index}.galaxyproject.eu"
type = "A"
ttl = "600"
records = ["${element(openstack_compute_instance_v2.celery.*.access_ip_v4, count.index)}"]
count = var.celery-count
}