diff --git a/openstack-tf/d4s-dev/geoportal/generic_smartgears_service.tf b/openstack-tf/d4s-dev/geoportal/generic_smartgears_service.tf deleted file mode 120000 index b8c2cf1..0000000 --- a/openstack-tf/d4s-dev/geoportal/generic_smartgears_service.tf +++ /dev/null @@ -1 +0,0 @@ -../../modules/generic_smartgears_service/generic_smartgears_service.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/geoportal/inputs.tf b/openstack-tf/d4s-dev/geoportal/inputs.tf index 2468226..1b1fe04 100644 --- a/openstack-tf/d4s-dev/geoportal/inputs.tf +++ b/openstack-tf/d4s-dev/geoportal/inputs.tf @@ -1,74 +1,4 @@ -#The Geoportal Instance -variable "smartgears_service_instances_map" { - type = map(object({ - name = string - description = string - flavor = string - networks = list(string) - security_groups = list(string) - block_device_uuid = string - })) - default = { - # Geoportal instance - geoportal_service = { - name = "geoportal-cms", - description = "The Geoportal instance", - flavor = "m1_large", - networks = ["d4s-dev-cloud-main", "postgresql-srv-net"], - security_groups = ["default", "http and https from the load balancers"] - block_device_uuid = "7ed6a2cd-2b07-482e-8ce4-f018dff16c89" #ubuntu_18_04.uuid of DEV - } - } - -} - - - -#Default smartgears_service is EMPTY. Override it to create a proper smartegears plan - -# locals { -# tags = { -# security_group_default = var.security_group_list.default -# security_group_http_and_https_lb = var.security_group_list.http_and_https_from_the_load_balancers -# ubuntu_18_04_instance_uuid = var.ubuntu_1804.uuid -# } -# } - -# locals { -# security_groups_1 = toset([var.security_group_list.default, var.security_group_list.http_and_https_from_the_load_balancers]) -# } - - -# variable "security_groups" { -# type = set(string) -# default = ["${security_group_default}", var.security_group_list.http_and_https_from_the_load_balancers] -# } - - -# locals { - -# smartgears_service_instances_map = { -# geoportal_service = { -# name = "geoportal-cms", -# description = "The Geoportal instance", -# flavor = "${var.flavor_list.m1_large}", -# networks = ["d4s-dev-cloud-main", "postgresql-srv-net"], -# security_groups = ["default", "http and https from the load balancers"] -# block_device_uuid = "7ed6a2cd-2b07-482e-8ce4-f018dff16c89" #ubuntu_18_04.uuid of DEV -# }, -# # URI-Resolver instance 1 -# uri_resolver_service_i1 = { -# name = "data", -# description = "The data instance", -# flavor = "m1.medium", -# networks = ["d4s-dev-cloud-main"], -# security_groups = ["default", "http and https from the load balancers"] -# block_device_uuid = "7ed6a2cd-2b07-482e-8ce4-f018dff16c89" #ubuntu_18_04.uuid of DEV -# } -# } -# } - - +# #The Geoportal Instance # variable "smartgears_service_instances_map" { # type = map(object({ # name = string @@ -78,7 +8,16 @@ variable "smartgears_service_instances_map" { # security_groups = list(string) # block_device_uuid = string # })) -# default = local.smartgears_service_instances_map +# default = { +# # Geoportal instance +# geoportal_service = { +# name = "geoportal-cms", +# description = "The Geoportal instance", +# flavor = "m1_large", +# networks = ["d4s-dev-cloud-main", "postgresql-srv-net"], +# security_groups = ["default", "http and https from the load balancers"] +# block_device_uuid = "7ed6a2cd-2b07-482e-8ce4-f018dff16c89" #ubuntu_18_04.uuid of DEV +# } +# } + # } - - diff --git a/openstack-tf/d4s-dev/geoportal/main.tf b/openstack-tf/d4s-dev/geoportal/main.tf index e3df3d8..eabcff0 100644 --- a/openstack-tf/d4s-dev/geoportal/main.tf +++ b/openstack-tf/d4s-dev/geoportal/main.tf @@ -16,3 +16,28 @@ data "terraform_remote_state" "privnet_dns_router" { path = "../project-setup/terraform.tfstate" } } + + +module "smartgears_service_generic" { + source = "../../modules/generic_smartgears_service" + + smartgears_service_instances_map = { + geoportal_service = { + name = "geoportal-cms", + description = "The Geoportal instance", + flavor = "m1.medium", + networks = ["d4s-dev-cloud-main", "postgresql-srv-net"], + security_groups = ["default", "http and https from the load balancers"] + block_device_uuid = "7ed6a2cd-2b07-482e-8ce4-f018dff16c89" #ubuntu_18_04.uuid of DEV + }, + # URI-Resolver instance 1 + uri_resolver_service_i1 = { + name = "data", + description = "The data instance", + flavor = "m1.medium", + networks = ["d4s-dev-cloud-main"], + security_groups = ["default", "http and https from the load balancers"] + block_device_uuid = "7ed6a2cd-2b07-482e-8ce4-f018dff16c89" #ubuntu_18_04.uuid of DEV + } + } +} diff --git a/openstack-tf/modules/generic_smartgears_service/terraform-provider.tf b/openstack-tf/modules/generic_smartgears_service/terraform-provider.tf new file mode 100644 index 0000000..a4b36e6 --- /dev/null +++ b/openstack-tf/modules/generic_smartgears_service/terraform-provider.tf @@ -0,0 +1,11 @@ +# Define required providers +terraform { +required_version = ">= 0.14.0" + required_providers { + openstack = { + source = "terraform-provider-openstack/openstack" + version = "~> 1.53.0" + } + } +} +