Skip to content

Commit 5d9cbde

Browse files
author
dpf
committed
Add RDS allocated storage, storage type and engine variables
1 parent e928c92 commit 5d9cbde

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,14 @@ For now the only authentication option is 'RBAC'. When enabling this, this modul
113113
| rbac\_admin\_lastname | RBAC Lastname (only when airflow\_authentication = 'rbac') | `string` | `"airflow"` | no |
114114
| rbac\_admin\_password | RBAC Password (only when airflow\_authentication = 'rbac') | `string` | `"admin"` | no |
115115
| rbac\_admin\_username | RBAC Username (only when airflow\_authentication = 'rbac') | `string` | `"admin"` | no |
116+
| rds\_allocated\_storage | The allocated storage for the rds db in gibibytes | `number` | `20` | no |
116117
| rds\_availability\_zone | Availability zone for the rds instance | `string` | `"eu-west-1a"` | no |
117118
| rds\_deletion\_protection | Deletion protection for the rds instance | `bool` | `false` | no |
119+
| rds\_engine | The database engine to use. For supported values, see the Engine parameter in [API action CreateDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html) | `string` | `"postgres"` | no |
118120
| rds\_instance\_class | The class of instance you want to give to your rds db | `string` | `"db.t2.micro"` | no |
119121
| rds\_password | Password of rds | `string` | `""` | no |
120122
| rds\_skip\_final\_snapshot | Whether or not to skip the final snapshot before deleting (mainly for tests) | `bool` | `false` | no |
123+
| rds\_storage\_type | One of `"standard"` (magnetic), `"gp2"` (general purpose SSD), or `"io1"` (provisioned IOPS SSD) | `string` | `"standard"` | no |
121124
| rds\_username | Username of rds | `string` | `"airflow"` | no |
122125
| region | The region to deploy your solution to | `string` | `"eu-west-1"` | no |
123126
| resource\_prefix | A prefix for the create resources, example your company name (be aware of the resource name length) | `string` | n/a | yes |
@@ -165,4 +168,4 @@ Make sure you branch from the 'open-pr-here' branch, and submit a PR back to the
165168

166169
## License
167170

168-
MIT license. Please see [LICENSE](LICENSE.md) for details.
171+
MIT license. Please see [LICENSE](LICENSE.md) for details.

rds.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
resource "aws_db_instance" "airflow" {
22
count = var.postgres_uri != "" || var.airflow_executor == "Sequential" ? 0 : 1
33
name = replace(title(local.rds_name), "-", "")
4-
allocated_storage = 20
5-
storage_type = "standard"
6-
engine = "postgres"
4+
allocated_storage = var.rds_allocated_storage
5+
storage_type = var.rds_storage_type
6+
engine = var.rds_engine
77
engine_version = "11.8"
88
instance_class = var.rds_instance_class
99
username = var.rds_username
@@ -27,4 +27,4 @@ resource "aws_db_subnet_group" "airflow" {
2727
subnet_ids = local.rds_ecs_subnet_ids
2828

2929
tags = local.common_tags
30-
}
30+
}

variables.tf

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,29 @@ variable "postgres_uri" {
206206
default = ""
207207
}
208208

209-
// TODO: Add more rds params
209+
variable "rds_allocated_storage" {
210+
type = number
211+
description = "The allocated storage for the rds db in gibibytes"
212+
default = 20
213+
}
214+
215+
variable "rds_storage_type" {
216+
type = string
217+
description = <<EOT
218+
One of "standard" (magnetic), "gp2" (general purpose SSD), or "io1" (provisioned IOPS SSD)
219+
EOT
220+
default = "standard"
221+
}
222+
223+
variable "rds_engine" {
224+
type = string
225+
description = <<EOT
226+
The database engine to use. For supported values, see the Engine parameter in
227+
[API action CreateDBInstance](https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html)
228+
EOT
229+
default = "postgres"
230+
}
231+
210232
variable "rds_username" {
211233
type = string
212234
description = "Username of rds"

0 commit comments

Comments
 (0)