Skip to content

Commit

Permalink
Merge pull request #12 from rhythmictech/add_mariadb
Browse files Browse the repository at this point in the history
Add Mariadb support to this module. Sure, why not.
  • Loading branch information
dgoodellrhy authored Jul 31, 2023
2 parents 9ba212a + d482946 commit 5311522
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
locals {
create_password_secret = var.password == null ? true : false
engine = "mysql"
final_snapshot_identifier = var.final_snapshot_identifier == null ? "${var.name}-final-snapshot" : var.final_snapshot_identifier
parameter_group_name = var.parameter_group_name == null ? aws_db_parameter_group.this[0].name : var.parameter_group_name
password = try(module.password.secret, var.password)
sg_name = "${var.name}-db-access"
param_group_family_name = var.param_group_family_name == null ? "${local.engine}${var.engine_version}" : var.param_group_family_name
param_group_family_name = var.param_group_family_name == null ? "${var.engine}${var.engine_version}" : var.param_group_family_name
sg_tags = merge(var.tags, { "Name" = "${var.name}-db-access" })
}

Expand Down Expand Up @@ -47,7 +46,7 @@ resource "aws_db_instance" "this" {
db_subnet_group_name = var.subnet_group_name
deletion_protection = var.enable_deletion_protection
enabled_cloudwatch_logs_exports = var.cloudwatch_log_exports
engine = local.engine
engine = var.engine
engine_version = var.engine_version
iam_database_authentication_enabled = var.iam_database_authentication_enabled
identifier_prefix = var.identifier_prefix
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ variable "enable_deletion_protection" {
type = bool
}

variable "engine" {
default = "mysql"
description = "Database Engine to use for RDS (mysql or mariadb are acceptable here)"
type = string
}

variable "engine_version" {
default = "5.7"
description = "Version of database engine to use"
Expand Down

0 comments on commit 5311522

Please sign in to comment.