Skip to content

Commit 4544a6e

Browse files
authored
Merge pull request #24 from datarootsio/ISSUE-23/rds_versioning
Allowed custom RDS versioning
2 parents 9ab743f + 141cd07 commit 4544a6e

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ For now the only authentication option is 'RBAC'. When enabling this, this modul
122122
| rds\_skip\_final\_snapshot | Whether or not to skip the final snapshot before deleting (mainly for tests) | `bool` | `false` | no |
123123
| rds\_storage\_type | One of `"standard"` (magnetic), `"gp2"` (general purpose SSD), or `"io1"` (provisioned IOPS SSD) | `string` | `"standard"` | no |
124124
| rds\_username | Username of rds | `string` | `"airflow"` | no |
125+
| rds\_version | The DB version to use for the RDS instance | `string` | `"12.7"` | no |
125126
| region | The region to deploy your solution to | `string` | `"eu-west-1"` | no |
126127
| resource\_prefix | A prefix for the create resources, example your company name (be aware of the resource name length) | `string` | n/a | yes |
127128
| resource\_suffix | A suffix for the created resources, example the environment for airflow to run in (be aware of the resource name length) | `string` | n/a | yes |

rds.tf

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
resource "aws_db_instance" "airflow" {
2-
count = var.postgres_uri != "" || var.airflow_executor == "Sequential" ? 0 : 1
3-
name = replace(title(local.rds_name), "-", "")
4-
allocated_storage = var.rds_allocated_storage
5-
storage_type = var.rds_storage_type
6-
engine = var.rds_engine
7-
engine_version = "11.8"
8-
instance_class = var.rds_instance_class
9-
username = var.rds_username
10-
password = var.rds_password
11-
multi_az = false
12-
availability_zone = var.rds_availability_zone
13-
publicly_accessible = false
14-
deletion_protection = var.rds_deletion_protection
15-
skip_final_snapshot = var.rds_skip_final_snapshot
16-
final_snapshot_identifier = "${var.resource_prefix}-airflow-${var.resource_suffix}-${local.timestamp_sanitized}"
17-
identifier = local.rds_name
18-
vpc_security_group_ids = [aws_security_group.airflow.id]
19-
db_subnet_group_name = aws_db_subnet_group.airflow[0].name
2+
count = var.postgres_uri != "" || var.airflow_executor == "Sequential" ? 0 : 1
3+
name = replace(title(local.rds_name), "-", "")
4+
allocated_storage = var.rds_allocated_storage
5+
storage_type = var.rds_storage_type
6+
engine = var.rds_engine
7+
engine_version = var.rds_version
8+
auto_minor_version_upgrade = false
9+
instance_class = var.rds_instance_class
10+
username = var.rds_username
11+
password = var.rds_password
12+
multi_az = false
13+
availability_zone = var.rds_availability_zone
14+
publicly_accessible = false
15+
deletion_protection = var.rds_deletion_protection
16+
skip_final_snapshot = var.rds_skip_final_snapshot
17+
final_snapshot_identifier = "${var.resource_prefix}-airflow-${var.resource_suffix}-${local.timestamp_sanitized}"
18+
identifier = local.rds_name
19+
vpc_security_group_ids = [aws_security_group.airflow.id]
20+
db_subnet_group_name = aws_db_subnet_group.airflow[0].name
2021

2122
tags = local.common_tags
2223
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,12 @@ variable "rds_deletion_protection" {
264264
default = false
265265
}
266266

267+
variable "rds_version" {
268+
type = string
269+
description = "The DB version to use for the RDS instance"
270+
default = "12.7"
271+
}
272+
267273
// S3 Bucket
268274
variable "s3_bucket_name" {
269275
type = string

0 commit comments

Comments
 (0)