-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dbp 817 implement ha mariadb cluster privacyidea (#26)
* DBP-817-add ionos-mariadb-cluster module * DBP-817-create mariadb_lan * DBP-817-correct naming conventions:lan_mariadb * terraform-docs: automated action --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
64bd8c0
commit 054af4a
Showing
11 changed files
with
189 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!-- BEGIN_TF_DOCS --> | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_ionoscloud"></a> [ionoscloud](#provider\_ionoscloud) | 6.3.6 | | ||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_cidr_workaround"></a> [cidr\_workaround](#module\_cidr\_workaround) | ../../modules/ionos-cidr-workaround | n/a | | ||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_cores"></a> [cores](#input\_cores) | The number of CPU cores per instance | `number` | n/a | yes | | ||
| <a name="input_datacenter_id"></a> [datacenter\_id](#input\_datacenter\_id) | The datacenter to connect your cluster to. | `string` | n/a | yes | | ||
| <a name="input_display_name"></a> [display\_name](#input\_display\_name) | The friendly name of your cluster | `string` | n/a | yes | | ||
| <a name="input_instances_count"></a> [instances\_count](#input\_instances\_count) | The total number of instances in the cluster (one primary and n-1 secondary) | `number` | n/a | yes | | ||
| <a name="input_k8s_cluster_id"></a> [k8s\_cluster\_id](#input\_k8s\_cluster\_id) | n/a | `string` | n/a | yes | | ||
| <a name="input_lan_id"></a> [lan\_id](#input\_lan\_id) | The LAN to connect your cluster to. | `string` | n/a | yes | | ||
| <a name="input_mariadb_version"></a> [mariadb\_version](#input\_mariadb\_version) | The MariaDB version of your cluster | `string` | n/a | yes | | ||
| <a name="input_memory"></a> [memory](#input\_memory) | The amount of memory per instance in gigabytes (GB) | `number` | n/a | yes | | ||
| <a name="input_password"></a> [password](#input\_password) | The password for the initial MariaDB user | `string` | n/a | yes | | ||
| <a name="input_username"></a> [username](#input\_username) | The username for the initial MariaDB user | `string` | n/a | yes | | ||
| <a name="input_volume_size"></a> [volume\_size](#input\_volume\_size) | The amount of storage per instance in gigabytes (GB) | `number` | n/a | yes | | ||
| <a name="input_ip_block"></a> [ip\_block](#input\_ip\_block) | The number to be set in the last ip block. (Default: 101) | `number` | `101` | no | | ||
| <a name="input_maintenance_day"></a> [maintenance\_day](#input\_maintenance\_day) | The day of the week for the 4 hour-long maintenance window. (Default: Sunday) | `string` | `"Sunday"` | no | | ||
| <a name="input_maintenance_hour"></a> [maintenance\_hour](#input\_maintenance\_hour) | The time of the day when the 4 hour-long maintenance window may start. (Default: 3) | `number` | `3` | no | | ||
| <a name="input_subnet_mask"></a> [subnet\_mask](#input\_subnet\_mask) | The subnet mask to use for allowing connections from the LAN. (Default: 16) | `string` | `16` | no | | ||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_dns_name"></a> [dns\_name](#output\_dns\_name) | The DNS name pointing to your cluster. | | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 | | ||
| <a name="requirement_ionoscloud"></a> [ionoscloud](#requirement\_ionoscloud) | 6.3.6 | | ||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [ionoscloud_mariadb_cluster.mariadb_cluster](https://registry.terraform.io/providers/ionos-cloud/ionoscloud/6.3.6/docs/resources/mariadb_cluster) | resource | | ||
<!-- END_TF_DOCS --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module "cidr_workaround" { | ||
source = "../../modules/ionos-cidr-workaround" | ||
k8s_cluster_id = var.k8s_cluster_id | ||
lan_id = var.lan_id | ||
} | ||
|
||
locals { | ||
nicIndex = module.cidr_workaround.nicIndex | ||
prefix = module.cidr_workaround.prefix | ||
full_ip = cidrhost(local.prefix, var.ip_block) | ||
cidr = format("%s/%s", local.full_ip, var.subnet_mask) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
resource "ionoscloud_mariadb_cluster" "mariadb_cluster" { | ||
mariadb_version = var.mariadb_version | ||
instances = var.instances_count | ||
cores = var.cores | ||
ram = var.memory | ||
storage_size = var.volume_size | ||
|
||
connections { | ||
datacenter_id = var.datacenter_id | ||
lan_id = var.lan_id | ||
cidr = local.cidr | ||
} | ||
display_name = var.display_name | ||
|
||
maintenance_window { | ||
day_of_the_week = var.maintenance_day | ||
time = format("%02d:00:00", var.maintenance_hour) | ||
} | ||
|
||
credentials { | ||
username = var.username | ||
password = var.password | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output "dns_name" { | ||
description = "The DNS name pointing to your cluster." | ||
value = ionoscloud_mariadb_cluster.mariadb_cluster.dns_name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
variable "mariadb_version" { | ||
description = "The MariaDB version of your cluster" | ||
type = string | ||
} | ||
variable "instances_count" { | ||
description = "The total number of instances in the cluster (one primary and n-1 secondary)" | ||
type = number | ||
} | ||
variable "cores" { | ||
description = "The number of CPU cores per instance" | ||
type = number | ||
} | ||
variable "memory" { | ||
description = "The amount of memory per instance in gigabytes (GB)" | ||
type = number | ||
} | ||
variable "volume_size" { | ||
description = "The amount of storage per instance in gigabytes (GB)" | ||
type = number | ||
} | ||
variable "display_name" { | ||
description = "The friendly name of your cluster" | ||
type = string | ||
} | ||
variable "maintenance_day" { | ||
description = "The day of the week for the 4 hour-long maintenance window. (Default: Sunday)" | ||
type = string | ||
default = "Sunday" | ||
} | ||
variable "maintenance_hour" { | ||
description = "The time of the day when the 4 hour-long maintenance window may start. (Default: 3)" | ||
type = number | ||
default = 3 | ||
} | ||
|
||
variable "username" { | ||
description = "The username for the initial MariaDB user" | ||
type = string | ||
} | ||
variable "password" { | ||
description = "The password for the initial MariaDB user" | ||
type = string | ||
} | ||
variable "k8s_cluster_id" { | ||
description = "" | ||
type = string | ||
} | ||
variable "lan_id" { | ||
description = "The LAN to connect your cluster to." | ||
type = string | ||
} | ||
variable "datacenter_id" { | ||
description = "The datacenter to connect your cluster to." | ||
type = string | ||
} | ||
variable "ip_block" { | ||
description = "The number to be set in the last ip block. (Default: 101)" | ||
type = number | ||
default = 101 | ||
} | ||
variable "subnet_mask" { | ||
description = "The subnet mask to use for allowing connections from the LAN. (Default: 16)" | ||
type = string | ||
default = 16 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
required_providers { | ||
ionoscloud = { | ||
source = "ionos-cloud/ionoscloud" | ||
version = "6.3.6" | ||
} | ||
} | ||
required_version = ">= 0.13" | ||
} |