Skip to content

Commit 5b9a841

Browse files
dploegerDennis Ploeger
authored andcommitted
fix: Smaller doc fix about public ips
Added terraform-module tools to the readme and fixed open findings, which made the suffix feature actually work.
1 parent 06cc050 commit 5b9a841

File tree

5 files changed

+27
-11
lines changed

5 files changed

+27
-11
lines changed

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ module "azure-mysql" {
2323
<!-- BEGIN_TF_DOCS -->
2424
## Requirements
2525

26-
No requirements.
26+
The following requirements are needed by this module:
27+
28+
- terraform (>=1.0.0)
29+
30+
- azurerm (>=3.63.0)
2731

2832
## Providers
2933

3034
The following providers are used by this module:
3135

32-
- azurerm
36+
- azurerm (>=3.63.0)
3337

3438
## Modules
3539

@@ -113,8 +117,10 @@ Default: `"mysqladmin"`
113117
### allowed\_ips
114118

115119
Description: A hash of permissions to access the database server by ip. The hash key is the name suffix and each value
116-
has a start and an end value. For public access set start\_ip\_address to 0.0.0.0 and end\_ip\_address to
117-
255.255.255.255. This variable is not used if public\_access = false.
120+
has a start and an end value.
121+
122+
* For public access set start to 0.0.0.0 and end to 255.255.255.255
123+
* To allow access from all Azure services to this database, set start and end to 0.0.0.0
118124

119125
Type:
120126

@@ -258,7 +264,6 @@ Description: FQDN of the database service
258264

259265
## Development
260266

261-
Use [terraform-docs](https://terraform-docs.io/) to generate the API documentation by running
267+
Use [the terraform module tools](https://github.com/dodevops/terraform-module-tools) to check and generate the documentation by running
262268

263-
terraform fmt .
264-
terraform-docs .
269+
docker run -v "$PWD":/terraform ghcr.io/dodevops/terraform-module-tools:latest

databases.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ resource "azurerm_mysql_flexible_database" "db" {
22
for_each = toset(var.database_suffixes)
33
resource_group_name = var.resource_group
44
server_name = azurerm_mysql_flexible_server.server.name
5-
name = "${var.project}${var.stage}db${each.value}"
5+
name = "${var.project}${var.stage}db${var.suffix}${each.value}"
66
charset = var.charset
77
collation = var.collation
88
}

server.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "azurerm_mysql_flexible_server" "server" {
2-
name = "${var.project}${var.stage}dbsrv"
2+
name = "${var.project}${var.stage}dbsrv${var.suffix}"
33
location = var.location
44
resource_group_name = var.resource_group
55
administrator_login = var.admin_login

terraform.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
terraform {
2+
required_version = ">=1.0.0"
3+
required_providers {
4+
azurerm = {
5+
source = "hashicorp/azurerm"
6+
version = ">=3.63.0"
7+
}
8+
}
9+
}

vars.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ variable "database_storage_iops" {
9393
variable "allowed_ips" {
9494
description = <<EOF
9595
A hash of permissions to access the database server by ip. The hash key is the name suffix and each value
96-
has a start and an end value. For public access set start_ip_address to 0.0.0.0 and end_ip_address to
97-
255.255.255.255. This variable is not used if public_access = false.
96+
has a start and an end value.
97+
98+
* For public access set start to 0.0.0.0 and end to 255.255.255.255
99+
* To allow access from all Azure services to this database, set start and end to 0.0.0.0
98100
EOF
99101
type = map(object({
100102
start = string,

0 commit comments

Comments
 (0)