2023-11-30 16:29:06 +01:00
|
|
|
# Define required providers
|
|
|
|
terraform {
|
|
|
|
required_version = ">= 0.14.0"
|
|
|
|
required_providers {
|
|
|
|
openstack = {
|
|
|
|
source = "terraform-provider-openstack/openstack"
|
|
|
|
version = "~> 1.53.0"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
data "terraform_remote_state" "privnet_dns_router" {
|
|
|
|
backend = "local"
|
|
|
|
|
|
|
|
config = {
|
|
|
|
path = "../project-setup/terraform.tfstate"
|
|
|
|
}
|
|
|
|
}
|
2023-12-04 11:01:16 +01:00
|
|
|
|
2023-12-05 10:06:23 +01:00
|
|
|
#
|
|
|
|
# Uses common_variables as module
|
|
|
|
#
|
|
|
|
module "common_variables" {
|
|
|
|
source = "../../modules/common_variables"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Creates the server group "uri-resolver"
|
|
|
|
#
|
|
|
|
resource "openstack_compute_servergroup_v2" "uri-resolver" {
|
|
|
|
name = "uri-resolver"
|
|
|
|
policies = [module.common_variables.policy_list.soft_anti_affinity]
|
|
|
|
}
|
|
|
|
|
2023-12-04 12:45:45 +01:00
|
|
|
|
2023-12-05 17:03:44 +01:00
|
|
|
module "instance_without_data_volume" {
|
|
|
|
source = "../../modules/instance_without_data_volume"
|
2023-12-04 12:45:45 +01:00
|
|
|
|
2023-12-05 17:03:44 +01:00
|
|
|
instances_without_data_volume_map = {
|
2023-12-05 10:06:23 +01:00
|
|
|
# URI-Resolver instance 1
|
2023-12-04 12:45:45 +01:00
|
|
|
uri_resolver_service_i1 = {
|
2023-12-05 11:22:22 +01:00
|
|
|
name = "data-1",
|
2023-12-04 12:45:45 +01:00
|
|
|
description = "The data instance",
|
2023-12-05 11:22:22 +01:00
|
|
|
flavor = module.common_variables.flavor_list.m1_medium,
|
2023-12-14 14:19:40 +01:00
|
|
|
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name],
|
|
|
|
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
|
2023-12-05 10:06:23 +01:00
|
|
|
server_groups_ids = [openstack_compute_servergroup_v2.uri-resolver.id],
|
2023-12-05 11:22:22 +01:00
|
|
|
image_ref = module.common_variables.ubuntu_1804
|
2023-12-04 12:45:45 +01:00
|
|
|
},
|
|
|
|
# URI-Resolver instance 2
|
|
|
|
uri_resolver_service_i2 = {
|
2023-12-05 11:22:22 +01:00
|
|
|
name = "data-2",
|
2023-12-04 12:45:45 +01:00
|
|
|
description = "The data1 instance",
|
2023-12-05 11:22:22 +01:00
|
|
|
flavor = module.common_variables.flavor_list.m1_medium,
|
2023-12-14 14:19:40 +01:00
|
|
|
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name],
|
|
|
|
security_groups = [data.terraform_remote_state.privnet_dns_router.outputs.default_security_group_name, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.http_and_https_from_the_load_balancers],
|
2023-12-05 10:06:23 +01:00
|
|
|
server_groups_ids = [openstack_compute_servergroup_v2.uri-resolver.id],
|
2023-12-05 11:22:22 +01:00
|
|
|
image_ref = module.common_variables.ubuntu_1804
|
2023-12-04 12:45:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|