Skip to content

Commit 57f05a1

Browse files
s2504sconst-bon
authored andcommitted
Add db_parameter option (#4)
1 parent 2b5e16e commit 57f05a1

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ The module will create:
4343
- `copy_tags_to_snapshot` - Copy all tags from RDS database to snapshot. Default `true`
4444
- `backup_retention_period` - Backup retention period in days (default `0`). Must be `> 0` to enable backups
4545
- `backup_window` - When to perform DB snapshots. Default `"22:00-03:00"`. Can't overlap with the maintenance window
46+
- `db_parameter` - A list of DB parameters to apply. Note that parameters may differ from a family to an other.
4647

4748

4849

@@ -92,6 +93,11 @@ module "rds_instance" {
9293
copy_tags_to_snapshot = true
9394
backup_retention_period = 7
9495
backup_window = "22:00-03:00"
96+
97+
db_parameter = [
98+
{ name = "myisam_sort_buffer_size" value = "1048576" },
99+
{ name = "sort_buffer_size" value = "2097152" },
100+
]
95101
}
96102
```
97103

main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ resource "aws_db_instance" "default" {
3737
}
3838

3939
resource "aws_db_parameter_group" "default" {
40-
name = "${module.label.id}"
41-
family = "${var.db_parameter_group}"
42-
tags = "${module.label.tags}"
40+
name = "${module.label.id}"
41+
family = "${var.db_parameter_group}"
42+
tags = "${module.label.tags}"
43+
parameter = "${var.db_parameter}"
4344
}
4445

4546
resource "aws_db_subnet_group" "default" {

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,8 @@ variable "tags" {
148148
type = "map"
149149
default = {}
150150
}
151+
152+
variable "db_parameter" {
153+
type = "list"
154+
default = []
155+
}

0 commit comments

Comments
 (0)