121 lines
No EOL
3.3 KiB
HCL
121 lines
No EOL
3.3 KiB
HCL
module "project" {
|
|
source = "../project"
|
|
|
|
name = "project-123"
|
|
labels = {
|
|
"example" = "test"
|
|
}
|
|
organization_id = var.organization_id
|
|
owner_email = "maximilian.schlenz@stackit.cloud"
|
|
}
|
|
|
|
module "security_groups" {
|
|
source = "../security-group"
|
|
|
|
for_each = var.security_groups
|
|
|
|
project_id = module.project.project_id
|
|
name = each.value.name
|
|
description = each.value.description != null ? each.value.description : ""
|
|
rules = each.value.rules
|
|
}
|
|
|
|
locals {
|
|
security_group_ids_by_name = {
|
|
for key, m in module.security_groups :
|
|
m.name => m.security_group_id
|
|
}
|
|
}
|
|
|
|
module "net" {
|
|
depends_on = [module.security_groups]
|
|
source = "../network"
|
|
|
|
for_each = var.networks
|
|
|
|
project_id = module.project.project_id
|
|
name = each.value.name
|
|
|
|
# IPv4 and IPv6 settings
|
|
ipv4_gateway = each.value.ipv4_gateway
|
|
ipv4_nameservers = each.value.ipv4_nameservers
|
|
ipv4_prefix = each.value.ipv4_prefix
|
|
ipv4_prefix_length = each.value.ipv4_prefix_length
|
|
|
|
ipv6_gateway = each.value.ipv6_gateway
|
|
ipv6_nameservers = each.value.ipv6_nameservers
|
|
ipv6_prefix = each.value.ipv6_prefix
|
|
ipv6_prefix_length = each.value.ipv6_prefix_length
|
|
|
|
no_ipv4_gateway = each.value.no_ipv4_gateway
|
|
no_ipv6_gateway = each.value.no_ipv6_gateway
|
|
routed = each.value.routed
|
|
labels = each.value.labels
|
|
|
|
# NIC options
|
|
nics = each.value.nics
|
|
security_group_ids_by_name = local.security_group_ids_by_name
|
|
}
|
|
|
|
module "postgres" {
|
|
source = "../postgres"
|
|
|
|
for_each = var.postgres_instances
|
|
|
|
project_id = module.project.project_id
|
|
name = each.value.name
|
|
ver = each.value.version
|
|
flavor = each.value.flavor
|
|
storage = each.value.storage
|
|
replicas = each.value.replicas
|
|
acl = each.value.acl
|
|
backup_schedule = each.value.backup_schedule
|
|
users = each.value.users
|
|
databases = each.value.databases
|
|
}
|
|
|
|
# module "ske" {
|
|
# source = "../ske"
|
|
|
|
# for_each = var.ske_clusters
|
|
|
|
# project_id = module.project.project_id
|
|
# name = each.value.name
|
|
# kubernetes_version_min = each.value.kubernetes_version_min
|
|
# node_pools = each.value.node_pools
|
|
# }
|
|
|
|
module "observability" {
|
|
source = "../observability"
|
|
for_each = var.observability_instances
|
|
|
|
project_id = module.project.project_id
|
|
|
|
name = each.value.name
|
|
plan_name = each.value.plan_name
|
|
|
|
acl = each.value.acl
|
|
metrics_retention_days = each.value.metrics_retention_days
|
|
metrics_retention_days_5m_downsampling = each.value.metrics_retention_days_5m_downsampling
|
|
metrics_retention_days_1h_downsampling = each.value.metrics_retention_days_1h_downsampling
|
|
alert_config = each.value.alert_config
|
|
parameters = each.value.parameters
|
|
|
|
# Credentials
|
|
create_credentials = each.value.create_credentials
|
|
credentials_count = each.value.credentials_count
|
|
|
|
alertgroups = each.value.alertgroups
|
|
|
|
logalertgroups = each.value.logalertgroups
|
|
|
|
scrapeconfigs = each.value.scrapeconfigs
|
|
}
|
|
|
|
|
|
output "obs_url" {
|
|
value = {
|
|
for key, instance in module.observability :
|
|
key => instance.observability_urls
|
|
}
|
|
} |