Skip to content

Commit 704b7d3

Browse files
authored
add storage size support and define replica region (#5)
1 parent 1004678 commit 704b7d3

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

.deepsource.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
version = 1
22

33
[[analyzers]]
4-
name = "terraform"
4+
name = "terraform"

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
repos:
22

33
- repo: https://github.com/gruntwork-io/pre-commit
4-
rev: v0.1.12 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
4+
rev: v0.1.23 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
55
hooks:
66
- id: terraform-fmt
77
- id: shellcheck
88
- id: tflint
99

10-
- repo: git://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.0.1 # Use the ref you want to point at
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v4.5.0 # Use the ref you want to point at
1212
hooks:
1313
- id: end-of-file-fixer
1414
- id: trailing-whitespace

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Terraform Module Database
88
</h1>
99

10-
<p align="center" style="font-size: 1.2rem;">
10+
<p align="center" style="font-size: 1.2rem;">
1111
Terraform module to create Digitalocean database service resource on Digitalocean.
1212
</p>
1313

@@ -41,7 +41,7 @@
4141
<hr>
4242

4343

44-
We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
44+
We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
4545

4646
This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.
4747

@@ -52,7 +52,7 @@ We have [*fifty plus terraform modules*][terraform_modules]. A few of them are c
5252

5353
## Prerequisites
5454

55-
This module has a few dependencies:
55+
This module has a few dependencies:
5656
- [Terraform 1.5.4](https://learn.hashicorp.com/terraform/getting-started/install.html)
5757

5858

@@ -385,7 +385,7 @@ Here are examples of how you can use this module in your inventory structure:
385385

386386

387387
## Testing
388-
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.
388+
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.
389389

390390
You need to run the following command in the testing folder:
391391
```hcl
@@ -394,7 +394,7 @@ You need to run the following command in the testing folder:
394394

395395

396396

397-
## Feedback
397+
## Feedback
398398
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/terraform-module-database/issues), or feel free to drop us an email at [[email protected]](mailto:[email protected]).
399399

400400
If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/clouddrove/terraform-module-database)!

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ resource "digitalocean_database_cluster" "cluster" {
2626
eviction_policy = var.redis_eviction_policy
2727
sql_mode = var.mysql_sql_mode
2828
project_id = var.project_id
29+
storage_size_mib = var.storage_size_mib
2930

3031
dynamic "maintenance_window" {
3132
for_each = var.cluster_maintenance != null ? [var.cluster_maintenance] : []
@@ -101,7 +102,7 @@ resource "digitalocean_database_replica" "replica-example" {
101102
cluster_id = join("", digitalocean_database_cluster.cluster[*].id)
102103
name = format("%s-${var.cluster_engine}-replica", module.labels.id)
103104
size = var.replica_size
104-
region = var.region
105+
region = var.replica_region
105106
tags = [module.labels.id]
106107
private_network_uuid = var.cluster_private_network_uuid
107108
}

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,8 @@ variable "replica_enable" {
147147
default = false
148148
description = "Flag to control the resources creation."
149149
}
150+
variable "storage_size_mib" {
151+
type = string
152+
description = "Defines the disk size, in MiB, allocated to the cluster"
153+
default = null
154+
}

0 commit comments

Comments
 (0)