81 lines
3.0 KiB
HCL
81 lines
3.0 KiB
HCL
# DMARC reports service of the S2I2S OpenStack project: parsedmarc, OpenSearch
|
|
# and OpenSearch Dashboards on one VM.
|
|
#
|
|
# The resources are in ../../modules/dmarc_reports, which also carries the
|
|
# sizing (m1.large: RAM 8 - VCPUs 4, 50 GB of SSD for the indexes) and the
|
|
# service port. Only what belongs to this project is set here: the address on
|
|
# the main private network, taken from the address plan in ../variables, and the
|
|
# IDs that come from the other workspaces.
|
|
#
|
|
# Apply order: main_net_dns_router -> project-setup -> this one.
|
|
|
|
data "terraform_remote_state" "privnet_dns_router" {
|
|
backend = "local"
|
|
config = {
|
|
path = "../main_net_dns_router/terraform.tfstate"
|
|
}
|
|
}
|
|
|
|
data "terraform_remote_state" "project_setup" {
|
|
backend = "local"
|
|
config = {
|
|
path = "../project-setup/terraform.tfstate"
|
|
}
|
|
}
|
|
|
|
module "labs_common_variables" {
|
|
source = "../../modules/labs_common_variables"
|
|
}
|
|
|
|
module "project_variables" {
|
|
source = "../variables"
|
|
}
|
|
|
|
module "ssh_settings" {
|
|
source = "../../modules/ssh-key-ref"
|
|
}
|
|
|
|
locals {
|
|
# From the network/DNS state
|
|
dns_zone = data.terraform_remote_state.privnet_dns_router.outputs.dns_zone
|
|
dns_zone_id = data.terraform_remote_state.privnet_dns_router.outputs.dns_zone_id
|
|
main_private_network_id = data.terraform_remote_state.privnet_dns_router.outputs.main_private_network_id
|
|
main_private_subnet_id = data.terraform_remote_state.privnet_dns_router.outputs.main_subnet_network_id
|
|
|
|
# From the project setup state
|
|
default_security_group_id = data.terraform_remote_state.project_setup.outputs.default_security_group_id
|
|
main_haproxy_l7_ip = data.terraform_remote_state.project_setup.outputs.main_haproxy_l7_ip
|
|
main_loadbalancer_name = data.terraform_remote_state.project_setup.outputs.main_loadbalancer_hostname
|
|
|
|
# From the common and project variables
|
|
availability_zone = module.labs_common_variables.availability_zones_names.availability_zone_no_gpu
|
|
ubuntu_2404 = module.labs_common_variables.ubuntu_2404
|
|
ubuntu2404_data_file = module.labs_common_variables.ubuntu2404_data_file
|
|
basic_services_ip = module.project_variables.basic_services_ip
|
|
}
|
|
|
|
module "dmarc_reports" {
|
|
source = "../../modules/dmarc_reports"
|
|
|
|
# Address plan of the project. The sizing comes from the module defaults
|
|
dmarc_reports_main_ip = local.basic_services_ip.dmarc_reports
|
|
|
|
main_private_network_id = local.main_private_network_id
|
|
main_private_subnet_id = local.main_private_subnet_id
|
|
default_security_group_id = local.default_security_group_id
|
|
haproxy_l7_ip = local.main_haproxy_l7_ip
|
|
|
|
availability_zone = local.availability_zone
|
|
image = {
|
|
uuid = local.ubuntu_2404.uuid
|
|
user_data_file = local.ubuntu2404_data_file
|
|
}
|
|
ssh_key_name = module.ssh_settings.ssh_key_name
|
|
|
|
# dmarc.s2i2s.cloud.isti.cnr.it, a CNAME of the main load balancer
|
|
dns_zone_id = local.dns_zone_id
|
|
dns_zone_name = local.dns_zone.name
|
|
dmarc_reports_public_name = "dmarc"
|
|
dmarc_reports_cname_target = local.main_loadbalancer_name
|
|
}
|