diff --git a/instance_maintenance.tf b/instance_maintenance.tf new file mode 100644 index 00000000..e9fbb7e8 --- /dev/null +++ b/instance_maintenance.tf @@ -0,0 +1,40 @@ +data "openstack_images_image_v2" "maintenance-image" { + name = "Rocky 9.0" +} + +resource "openstack_compute_instance_v2" "maintenance" { + name = "maintenance.galaxyproject.eu" + image_id = data.openstack_images_image_v2.maintenance-image.id + flavor_name = "m1.xlarge" + key_pair = "cloud2" + tags = [] + security_groups = ["default"] + + network { + name = "bioinf" + } + + block_device { + uuid = data.openstack_images_image_v2.maintenance-image.id + source_type = "image" + volume_size = 256 + destination_type = "volume" + boot_index = 0 + delete_on_termination = true + } + + user_data = <<-EOF + #cloud-config + package_update: true + package_upgrade: true + EOF +} + +resource "aws_route53_record" "maintenance-galaxyproject" { + allow_overwrite = true + zone_id = var.zone_galaxyproject_eu + name = "maintenance.galaxyproject.eu" + type = "A" + ttl = "600" + records = ["${openstack_compute_instance_v2.maintenance.access_ip_v4}"] +}