infrastructure-as-code/openstack-tf/d4s-production/dataminer/main.tf

200 lines
11 KiB
Terraform
Raw Normal View History

2023-12-15 18:09:26 +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"
}
}
#
# Uses common_variables as module
#
module "common_variables" {
source = "../../modules/common_variables"
}
module "instance_with_data_volume" {
source = "../../modules/instance_with_data_volume"
instances_with_data_volume_map = {
dataminer_1_proto_1804 = {
name = "dataminer1-proto-1804",
2023-12-15 18:12:22 +01:00
description = "This instance is a DataMiner service",
2023-12-15 18:09:26 +01:00
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
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],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_1_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
2023-12-15 18:30:06 +01:00
},
dataminer_2_proto_1804 = {
name = "dataminer2-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
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],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_2_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_3_proto_1804 = {
name = "dataminer3-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
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],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_3_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_4_proto_1804 = {
name = "dataminer4-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
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],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_4_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_5_proto_1804 = {
name = "dataminer5-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
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],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_5_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_6_proto_1804 = {
name = "dataminer6-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
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],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_6_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_7_proto_1804 = {
name = "dataminer7-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
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],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_7_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_8_proto_1804 = {
name = "dataminer8-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.m1_xxl,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
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],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_8_proto_1804_data_volume",
size = "80",
device = "/dev/vdb"
}
},
dataminer_2_gw_proto_1804 = {
name = "dataminer2-gw-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.c2_large,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
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],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_2_gw_proto_1804_data_volume",
size = "40",
device = "/dev/vdb"
}
},
dataminer_3_gw_proto_1804 = {
name = "dataminer3-gw-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.c2_large,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
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],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_3_gw_proto_1804_data_volume",
size = "40",
device = "/dev/vdb"
}
},
dataminer_4_gw_proto_1804 = {
name = "dataminer4-gw-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.c2_large,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
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],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_4_gw_proto_1804_data_volume",
size = "40",
device = "/dev/vdb"
}
},
dataminer_5_gw_proto_1804 = {
name = "dataminer5-gw-proto-1804",
description = "This instance is a DataMiner service",
flavor = module.common_variables.flavor_list.c2_large,
networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.shared_postgresql],
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],
server_groups_ids = [],
image_ref = module.common_variables.ubuntu_1804
volume = {
name = "dataminer_5_gw_proto_1804_data_volume",
size = "40",
device = "/dev/vdb"
}
2023-12-15 18:09:26 +01:00
}
}
}