Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dbp 817 implement ha mariadb cluster privacyidea #27

Closed
wants to merge 11 commits into from
4 changes: 4 additions & 0 deletions modules/ionos-datacenter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ No modules.
| <a name="input_create_alb_target_lan"></a> [create\_alb\_target\_lan](#input\_create\_alb\_target\_lan) | Specifies whether a private target for the Application Load Balancer shall be created. | `bool` | `false` | no |
| <a name="input_create_backend_crossconnect"></a> [create\_backend\_crossconnect](#input\_create\_backend\_crossconnect) | Specifies whether crossconnect shall be created. Default: false. | `bool` | `false` | no |
| <a name="input_create_frontend_crossconnect"></a> [create\_frontend\_crossconnect](#input\_create\_frontend\_crossconnect) | Specifies whether crossconnect shall be created. Default: false. | `bool` | `false` | no |
| <a name="input_create_mariadb_lan"></a> [create\_mariadb\_lan](#input\_create\_mariadb\_lan) | Specifies whether a private lan to connect Mariadb shall be created. | `bool` | `false` | no |
| <a name="input_create_nat_lan"></a> [create\_nat\_lan](#input\_create\_nat\_lan) | Specifies whether a private lan to connect a NAT gateway shall be created. | `bool` | `false` | no |
| <a name="input_create_nfs_server_lan"></a> [create\_nfs\_server\_lan](#input\_create\_nfs\_server\_lan) | Specifies whether a private lan to connect an NFS server shall be created. | `bool` | `false` | no |
| <a name="input_create_nlb_target_lan"></a> [create\_nlb\_target\_lan](#input\_create\_nlb\_target\_lan) | Specifies whether a private target for the Network Load Balancer shall be created. | `bool` | `false` | no |
Expand All @@ -45,12 +46,14 @@ No modules.
| <a name="output_lan_alb_target"></a> [lan\_alb\_target](#output\_lan\_alb\_target) | n/a |
| <a name="output_lan_backend"></a> [lan\_backend](#output\_lan\_backend) | n/a |
| <a name="output_lan_frontend"></a> [lan\_frontend](#output\_lan\_frontend) | n/a |
| <a name="output_lan_mariadb"></a> [lan\_mariadb](#output\_lan\_mariadb) | n/a |
| <a name="output_lan_nat"></a> [lan\_nat](#output\_lan\_nat) | n/a |
| <a name="output_lan_nfs_server"></a> [lan\_nfs\_server](#output\_lan\_nfs\_server) | n/a |
| <a name="output_lan_nlb_target"></a> [lan\_nlb\_target](#output\_lan\_nlb\_target) | n/a |
| <a name="output_lan_postgres"></a> [lan\_postgres](#output\_lan\_postgres) | n/a |
| <a name="output_lan_service"></a> [lan\_service](#output\_lan\_service) | n/a |
| <a name="output_lans_custom"></a> [lans\_custom](#output\_lans\_custom) | n/a |
| <a name="output_mariadb_lan_id"></a> [mariadb\_lan\_id](#output\_mariadb\_lan\_id) | n/a |
| <a name="output_nat_lan_id"></a> [nat\_lan\_id](#output\_nat\_lan\_id) | n/a |
| <a name="output_nfs_server_lan_id"></a> [nfs\_server\_lan\_id](#output\_nfs\_server\_lan\_id) | n/a |
| <a name="output_nlb_target_lan_id"></a> [nlb\_target\_lan\_id](#output\_nlb\_target\_lan\_id) | n/a |
Expand All @@ -71,6 +74,7 @@ No modules.
| [ionoscloud_lan.backend_lan](https://registry.terraform.io/providers/ionos-cloud/ionoscloud/6.3.6/docs/resources/lan) | resource |
| [ionoscloud_lan.custom_lan](https://registry.terraform.io/providers/ionos-cloud/ionoscloud/6.3.6/docs/resources/lan) | resource |
| [ionoscloud_lan.frontend_lan](https://registry.terraform.io/providers/ionos-cloud/ionoscloud/6.3.6/docs/resources/lan) | resource |
| [ionoscloud_lan.mariadb_lan](https://registry.terraform.io/providers/ionos-cloud/ionoscloud/6.3.6/docs/resources/lan) | resource |
| [ionoscloud_lan.nat_lan](https://registry.terraform.io/providers/ionos-cloud/ionoscloud/6.3.6/docs/resources/lan) | resource |
| [ionoscloud_lan.nfs_server_lan](https://registry.terraform.io/providers/ionos-cloud/ionoscloud/6.3.6/docs/resources/lan) | resource |
| [ionoscloud_lan.nlb_target_lan](https://registry.terraform.io/providers/ionos-cloud/ionoscloud/6.3.6/docs/resources/lan) | resource |
Expand Down
2 changes: 2 additions & 0 deletions modules/ionos-datacenter/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ locals {
service_crossconnect_shared_group_ids = (length(var.crossconnect_shared_group_ids) > 0 && local.create_frontend_crossconnect == true) ? var.crossconnect_shared_group_ids : []
routes_map = var.routes_map
create_postgres_lan = var.create_postgres_lan
create_mariadb_lan = var.create_mariadb_lan
custom_lans_to_create = var.custom_lans_to_create
# this saves the service/backend/frontend lans as an object in a list
# Example of an object:
Expand All @@ -34,6 +35,7 @@ locals {
lan_frontend = flatten([ for id in ionoscloud_lan.frontend_lan.*.id: { id = id, routes_list = lookup(local.routes_map, id , [{}]) }])
lan_nfs_server = flatten([ for id in ionoscloud_lan.nfs_server_lan.*.id: { id = id, routes_list = [{}] }])
lan_postgres = flatten([ for id in ionoscloud_lan.postgres_lan.*.id: { id = id, routes_list = [{}] }])
lan_mariadb = flatten([ for id in ionoscloud_lan.mariadb_lan.*.id: { id = id, routes_list = [{}] }])
lan_alb_target = flatten([ for id in ionoscloud_lan.alb_target_lan.*.id: { id = id, routes_list =[{}] }])
lan_nlb_target = flatten([ for id in ionoscloud_lan.nlb_target_lan.*.id: { id = id, routes_list =[{}] }])
lan_nat = flatten([ for id in ionoscloud_lan.nat_lan.*.id: { id = id, routes_list = [{}] }])
Expand Down
7 changes: 7 additions & 0 deletions modules/ionos-datacenter/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ resource "ionoscloud_lan" "postgres_lan" {
public = false
}

resource "ionoscloud_lan" "mariadb_lan" {
count = local.create_mariadb_lan ? 1 : 0
name = "${var.datacenter_name}-mariadb-lan"
datacenter_id = ionoscloud_datacenter.datacenter.id
public = false
}

resource "ionoscloud_lan" "alb_target_lan" {
count = local.create_alb_target_lan ? 1 : 0
name = "${var.datacenter_name}-alb-target-lan"
Expand Down
8 changes: 8 additions & 0 deletions modules/ionos-datacenter/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ output "lan_postgres" {
value = local.lan_postgres
}

output "mariadb_lan_id" {
value = join("", ionoscloud_lan.mariadb_lan.*.id)
}

output "lan_mariadb" {
value = local.lan_mariadb
}

output "alb_target_lan_id" {
value = join("", ionoscloud_lan.alb_target_lan.*.id)
}
Expand Down
5 changes: 5 additions & 0 deletions modules/ionos-datacenter/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ variable "create_postgres_lan" {
type = bool
default = false
}
variable "create_mariadb_lan" {
description = "Specifies whether a private lan to connect Mariadb shall be created."
type = bool
default = false
}

variable "create_alb_target_lan" {
type = bool
Expand Down
Loading