From 4a59deaffe720160eaf60dc960fc04177c6d7b45 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 19 Jan 2024 19:05:15 +0100 Subject: [PATCH] social service in preproduction. --- .../d4s-preprod/socialservice/main.tf | 40 +++++++++++++++++++ .../d4s-preprod/socialservice/provider.tf | 3 ++ 2 files changed, 43 insertions(+) create mode 100644 openstack-tf/d4s-preprod/socialservice/main.tf create mode 100644 openstack-tf/d4s-preprod/socialservice/provider.tf diff --git a/openstack-tf/d4s-preprod/socialservice/main.tf b/openstack-tf/d4s-preprod/socialservice/main.tf new file mode 100644 index 0000000..1ebdad6 --- /dev/null +++ b/openstack-tf/d4s-preprod/socialservice/main.tf @@ -0,0 +1,40 @@ +# 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_without_data_volume" { + source = "../../modules/instance_without_data_volume" + + instances_without_data_volume_map = { + accounting_service_1 = { + name = "socialservice-01", + description = "Social service API service", + flavor = module.common_variables.flavor_list.m1_medium, + networks = [data.terraform_remote_state.privnet_dns_router.outputs.main_private_network.name, module.common_variables.networks_list.cassandra], + 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, data.terraform_remote_state.privnet_dns_router.outputs.security_group_list.debugging_from_jump_node], + image_ref = module.common_variables.ubuntu_1804 + } + } +} diff --git a/openstack-tf/d4s-preprod/socialservice/provider.tf b/openstack-tf/d4s-preprod/socialservice/provider.tf new file mode 100644 index 0000000..5c9deb7 --- /dev/null +++ b/openstack-tf/d4s-preprod/socialservice/provider.tf @@ -0,0 +1,3 @@ +provider "openstack" { + cloud = "d4s-pre" +}