Skip to content

Commit 9619819

Browse files
authored
Merge pull request #21 from souza-dan/engine-version
DEV-14965 - Removes patch version from the engine version
2 parents 15d3de7 + b223ed5 commit 9619819

File tree

9 files changed

+41
-30
lines changed

9 files changed

+41
-30
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Tamr Terraform Template Repo
22

3+
## v3.0.0 - July 27th 2021
4+
* Updates default engine version to not specify a minor version
5+
* Adds new variable `auto_minor_version_upgrade` to allow AWS to upgrade RDS minor versions
6+
37
## v2.1.0 - July 12nd 2021
48
* Adds tags for RDS Subnet Group.
59
* Adds new variable `tags` to set tags for all resources

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This repo follows the [terraform standard module structure](https://www.terrafor
77
Inline example implementation of the module. This is the most basic example of what it would look like to use this module.
88
```
99
module "rds_postgres" {
10-
source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=2.0.0"
10+
source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=x.y.z"
1111
postgres_name = "example_rds_postgres"
1212
parameter_group_name = "example-rds-postgres-pg"
1313
identifier_prefix = "example-rds-"
@@ -50,18 +50,19 @@ This terraform module will create:
5050
|------|-------------|------|---------|:--------:|
5151
| password | The password for the master DB user. | `string` | n/a | yes |
5252
| rds\_subnet\_ids | VPC subnet IDs in subnet group | `list(string)` | n/a | yes |
53-
| security\_group\_ids | List of security group IDs to allow ingress from (i.e. Spark cluster SG IDs, Tamr VM SG ID) | `list(string)` | n/a | yes |
53+
| security\_group\_ids | List of security group IDs to associate | `list(string)` | n/a | yes |
5454
| subnet\_group\_name | The name of the subnet group to add the RDS instance to | `string` | n/a | yes |
5555
| vpc\_id | VPC ID for the rds security group | `string` | n/a | yes |
5656
| additional\_cidrs | Additional CIDR to connect to RDS Postgres instance | `list(string)` | `[]` | no |
5757
| additional\_tags | [DEPRECATED: Use `tags` instead] Additional tags to set on the RDS instance. | `map(string)` | `{}` | no |
5858
| allocated\_storage | Allocate storage | `number` | `20` | no |
5959
| apply\_immediately | Apply immediately, do not set this to true for production | `bool` | `false` | no |
60+
| auto\_minor\_version\_upgrade | Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window | `bool` | `true` | no |
6061
| backup\_retention\_period | Backup retention period in days | `number` | `14` | no |
6162
| backup\_window | Backup window | `string` | `"03:29-03:59"` | no |
6263
| copy\_tags\_to\_snapshot | Copy tags to snapshots | `bool` | `true` | no |
6364
| db\_port | The port on which the database accepts connections. | `number` | `5432` | no |
64-
| engine\_version | Version of RDS Postgres | `string` | `"12.3"` | no |
65+
| engine\_version | Version of RDS Postgres | `string` | `"12"` | no |
6566
| identifier\_prefix | Identifier prefix for the RDS instance | `string` | `"tamr-rds-"` | no |
6667
| instance\_class | Instance class | `string` | `"db.m4.large"` | no |
6768
| maintenance\_window | Maintenance window | `string` | `"sun:04:32-sun:05:02"` | no |

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.0
1+
3.0.0

examples/minimal/main.tf

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "rds_postgres" {
2-
# source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=2.0.0"
2+
# source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git?ref=3.0.0"
33
source = "../.."
44

55
identifier_prefix = "example-rds-pg-"
@@ -8,27 +8,27 @@ module "rds_postgres" {
88
username = "exampleUsername"
99
password = "examplePassword" #tfsec:ignore:GEN003
1010

11-
vpc_id = var.vpc_id
12-
subnet_group_name = "example_subnet_group"
11+
vpc_id = var.vpc_id
12+
subnet_group_name = "example_subnet_group"
1313
# Network requirement: DB subnet group needs a subnet in at least two Availability Zones
14-
rds_subnet_ids = var.subnet_ids
14+
rds_subnet_ids = var.subnet_ids
1515
security_group_ids = module.rds-postgres-sg.security_group_ids
1616
tags = var.tags
1717
}
1818

1919
module "sg-ports" {
20-
# source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git//modules/rds-postgres-ports?ref=2.0.0"
20+
# source = "git::https://github.com/Datatamer/terraform-aws-rds-postgres.git//modules/rds-postgres-ports?ref=3.0.0"
2121
source = "../../modules/rds-postgres-ports"
2222
}
2323

2424
module "rds-postgres-sg" {
25-
source = "git::[email protected]:Datatamer/terraform-aws-security-groups.git?ref=1.0.0"
26-
vpc_id = var.vpc_id
25+
source = "git::[email protected]:Datatamer/terraform-aws-security-groups.git?ref=1.0.0"
26+
vpc_id = var.vpc_id
2727
ingress_cidr_blocks = var.ingress_cidr_blocks
28-
egress_cidr_blocks = var.egress_cidr_blocks
29-
ingress_ports = module.sg-ports.ingress_ports
30-
sg_name_prefix = var.name_prefix
31-
egress_protocol = "all"
32-
ingress_protocol = "tcp"
33-
tags = var.tags
28+
egress_cidr_blocks = var.egress_cidr_blocks
29+
ingress_ports = module.sg-ports.ingress_ports
30+
sg_name_prefix = var.name_prefix
31+
egress_protocol = "all"
32+
ingress_protocol = "tcp"
33+
tags = var.tags
3434
}

examples/minimal/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
output "ingress_ports" {
2-
value = module.sg-ports
2+
value = module.sg-ports
33
description = "List of ingress ports"
44
}
55

examples/minimal/variables.tf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,20 @@ variable "name_prefix" {
1919

2020
variable "ingress_cidr_blocks" {
2121
description = "CIDR blocks to attach to security groups for ingress"
22-
type = list(string)
22+
type = list(string)
2323
}
2424

2525
variable "egress_cidr_blocks" {
2626
description = "CIDR blocks to attach to security groups for egress"
27-
type = list(string)
28-
default = ["0.0.0.0/0"]
27+
type = list(string)
28+
default = ["0.0.0.0/0"]
2929
}
3030

3131
variable "tags" {
3232
type = map(string)
3333
description = "A map of tags to add to all resources created by this example."
34-
default = {
35-
Author = "Tamr"
34+
default = {
35+
Author = "Tamr"
3636
Environment = "Example"
3737
}
3838
}
39-

main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ resource "aws_db_instance" "rds_postgres" {
2424
storage_type = var.storage_type
2525
storage_encrypted = true
2626

27-
engine = "postgres"
28-
engine_version = var.engine_version
29-
instance_class = var.instance_class
27+
engine = "postgres"
28+
engine_version = var.engine_version
29+
instance_class = var.instance_class
30+
auto_minor_version_upgrade = var.auto_minor_version_upgrade
3031

3132
username = var.username
3233
password = var.password
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
output "ingress_ports" {
22
value = concat(
3-
var.ports,
4-
var.additional_ports,
3+
var.ports,
4+
var.additional_ports,
55
)
66
description = "List of ingress ports"
77
}

variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,17 @@ variable "additional_cidrs" {
140140
variable "engine_version" {
141141
description = "Version of RDS Postgres"
142142
type = string
143-
default = "12.3"
143+
default = "12"
144144
}
145145

146146
variable "parameter_group_family" {
147147
description = "The family of the DB parameter group"
148148
type = string
149149
default = "postgres12"
150150
}
151+
152+
variable "auto_minor_version_upgrade" {
153+
default = true
154+
type = bool
155+
description = "Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window"
156+
}

0 commit comments

Comments
 (0)