infrastructure-as-code/openstack-tf/d4s-dev/gcat/main.tf

61 lines
1.9 KiB
Terraform
Raw Normal View History

2023-12-04 16:27:09 +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-05 12:12:07 +01:00
#
# Uses common_variables as module
#
module "common_variables" {
source = "../../modules/common_variables"
}
#
# Creates the server group "gcat"
2023-12-05 12:12:07 +01:00
#
resource "openstack_compute_servergroup_v2" "gcat_server_group" {
name = "gcat"
policies = [module.common_variables.policy_list.soft_anti_affinity]
}
2023-12-04 16:27:09 +01:00
module "smartgears_service_generic" {
source = "../../modules/generic_smartgears_service"
smartgears_service_instances_map = {
gcat_1 = {
name = "gcat-1",
description = "This instance serves gcat service",
2023-12-05 12:12:07 +01:00
flavor = module.common_variables.flavor_list.m1_medium,
2023-12-04 16:27:09 +01:00
networks = ["d4s-dev-cloud-main"],
2023-12-05 12:12:07 +01:00
security_groups = [module.common_variables.security_group_list.default, module.common_variables.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [openstack_compute_servergroup_v2.gcat_server_group.id],
image_ref = module.common_variables.ubuntu_1804
2023-12-04 16:27:09 +01:00
},
gcat_2 = {
name = "gcat-2",
description = "This instance serves gcat service",
2023-12-05 12:12:07 +01:00
flavor = module.common_variables.flavor_list.m1_medium,
2023-12-04 16:27:09 +01:00
networks = ["d4s-dev-cloud-main"],
2023-12-05 12:12:07 +01:00
security_groups = [module.common_variables.security_group_list.default, module.common_variables.security_group_list.http_and_https_from_the_load_balancers],
server_groups_ids = [openstack_compute_servergroup_v2.gcat_server_group.id],
image_ref = module.common_variables.ubuntu_1804
2023-12-04 16:27:09 +01:00
}
}
}