Skip to content

Commit 45183f4

Browse files
chores(syntax): Fix formatting. (#2)
1 parent 9908775 commit 45183f4

File tree

4 files changed

+43
-43
lines changed

4 files changed

+43
-43
lines changed

main.tf

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
resource "random_password" "this" {
22
count = var.user_password != null ? 0 : 1
33

4-
length = 16
5-
min_lower = 1
4+
length = 16
5+
min_lower = 1
66
min_numeric = 1
77
min_special = 1
8-
min_upper = 1
9-
special = true
8+
min_upper = 1
9+
special = true
1010
}
1111

1212
resource "scaleway_rdb_instance" "this" {
13-
engine = var.engine
14-
is_ha_cluster = var.ha_enabled
15-
name = var.name
16-
node_type = var.node_type
13+
engine = var.engine
14+
is_ha_cluster = var.ha_enabled
15+
name = var.name
16+
node_type = var.node_type
1717

18-
volume_size_in_gb = var.volume_size_in_gb
19-
volume_type = var.volume_type
18+
volume_size_in_gb = var.volume_size_in_gb
19+
volume_type = var.volume_type
2020

21-
user_name = var.user_name
22-
password = var.user_password != null ? var.user_password : random_password.this[0].result
21+
user_name = var.user_name
22+
password = var.user_password != null ? var.user_password : random_password.this[0].result
2323

2424
disable_backup = var.backup_disabled
2525
backup_same_region = var.backup_same_region
2626
backup_schedule_frequency = var.backup_schedule_frequency
2727
backup_schedule_retention = var.backup_schedule_retention
2828

29-
region = var.region
30-
project_id = var.project_id
31-
tags = var.tags
29+
region = var.region
30+
project_id = var.project_id
31+
tags = var.tags
3232

3333
dynamic "private_network" {
3434
for_each = var.private_network != null ? [1] : []
3535
content {
36-
pn_id = try(var.private_network.pn_id, null)
36+
pn_id = try(var.private_network.pn_id, null)
3737
ip_net = try(var.private_network.ip_net, null)
3838
}
3939
}

outputs.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ output "instance_id" {
1010

1111
output "load_balancer" {
1212
description = "List of load balancer endpoints of the database instance."
13-
value = scaleway_rdb_instance.this.load_balancer
13+
value = scaleway_rdb_instance.this.load_balancer
1414
}
1515

1616
output "replicate_pn" {
1717
description = "Private network attributes of the read replica."
18-
value = scaleway_rdb_read_replica.this.*.private_network
18+
value = scaleway_rdb_read_replica.this.*.private_network
1919
}
2020

2121
output "user_password" {
2222
description = "Password generated if non were given."
23-
sensitive = true
24-
value = try(random_password.this.0.result, null)
23+
sensitive = true
24+
value = try(random_password.this.0.result, null)
2525
}

variables.tf

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
## Instance topology
22
variable "engine" {
33
description = "Database Instance's engine version (e.g. PostgreSQL-11)."
4-
type = string
4+
type = string
55
}
66

77
variable "ha_enabled" {
88
description = "Enable or disable high availability for the database instance."
9-
type = bool
10-
default = false
9+
type = bool
10+
default = false
1111
}
1212

1313
variable "name" {
1414
description = "Name of the Database Instance"
15-
type = string
15+
type = string
1616
}
1717

1818
variable "node_type" {
1919
description = "Type of database instance you want to create (e.g. db-dev-s)."
20-
type = string
20+
type = string
2121
}
2222

2323
## Network
2424
variable "private_network" {
2525
description = "Describes the private network you want to connect to your cluster. If not set, a public network will be provided."
2626
type = object({
27-
pn_id = string
27+
pn_id = string
2828
ip_net = string
2929
})
3030
default = null
@@ -33,8 +33,8 @@ variable "private_network" {
3333
## Storage
3434
variable "volume_type" {
3535
description = "Type of volume where data are stored (bssd or lssd)."
36-
type = string
37-
default = "lssd"
36+
type = string
37+
default = "lssd"
3838

3939
validation {
4040
condition = contains(["bssd", "lssd"], var.volume_type)
@@ -44,39 +44,39 @@ variable "volume_type" {
4444

4545
variable "volume_size_in_gb" {
4646
description = "Volume size (in GB) when volume_type is set to bssd. Must be a multiple of 5000000000."
47-
type = number
48-
default = null
47+
type = number
48+
default = null
4949
}
5050

5151
## Backup
5252
variable "backup_disabled" {
5353
description = "Disable automated backup for the database instance."
54-
type = bool
55-
default = false
54+
type = bool
55+
default = false
5656
}
5757

5858
variable "backup_same_region" {
5959
description = "Whether logical backups are stored in the same region as the database instance."
60-
type = bool
61-
default = false
60+
type = bool
61+
default = false
6262
}
6363

6464
variable "backup_schedule_frequency" {
6565
description = "Backup schedule frequency in hours."
66-
type = number
67-
default = 24
66+
type = number
67+
default = 24
6868
}
6969

7070
variable "backup_schedule_retention" {
7171
description = "Backup schedule retention in days."
72-
type = number
73-
default = 7
72+
type = number
73+
default = 7
7474
}
7575

7676
## User informations
7777
variable "user_name" {
7878
description = "Identifier for the first user of the database instance. **Warning** Changing the user_name will recreate the Database Instance."
79-
type = string
79+
type = string
8080

8181
validation {
8282
condition = can(regex("^[-_a-zA-Z0-9]{1,63}$", var.user_name))
@@ -86,9 +86,9 @@ variable "user_name" {
8686

8787
variable "user_password" {
8888
description = "Password for the first user of the database instance. A random password will be generated if null."
89-
sensitive = true
90-
type = string
91-
default = null
89+
sensitive = true
90+
type = string
91+
default = null
9292
}
9393

9494
## Read replicas

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_version = ">= 0.13"
33
required_providers {
44
random = {
5-
source = "hashicorp/random"
5+
source = "hashicorp/random"
66
version = ">= 3.4.3"
77
}
88
scaleway = {

0 commit comments

Comments
 (0)