-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathinstance_core_celery.tf
More file actions
46 lines (39 loc) · 1.17 KB
/
instance_core_celery.tf
File metadata and controls
46 lines (39 loc) · 1.17 KB
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
variable "celery-count" {
default = 3
}
data "openstack_images_image_v2" "celery-image" {
name = "Rocky 9.4"
}
resource "openstack_compute_instance_v2" "celery" {
name = "celery-cloud-${count.index}.galaxyproject.eu"
flavor_name = "m1.xxlarge"
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
block_device {
uuid = data.openstack_images_image_v2.celery-image.id
source_type = "image"
destination_type = "volume"
boot_index = 0
volume_size = 35
delete_on_termination = true
}
count = var.celery-count
}
resource "aws_route53_record" "celery-cloud-galaxyproject" {
allow_overwrite = true
zone_id = var.zone_galaxyproject_eu
name = "celery-cloud-${count.index}.galaxyproject.eu"
type = "A"
ttl = "600"
records = ["${element(openstack_compute_instance_v2.celery.*.access_ip_v4, count.index)}"]
count = var.celery-count
}