Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions example/mariaDb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ module "mariadb" {
engine_name = "MariaDB"
allocated_storage = 50

db_name = "test"
username = "user"
password = "esfsgcGdfawAhdxtfjm!"
port = "3306"
db_name = "test"
username = "user"
manage_master_user_password = true
port = "3306"

maintenance_window = "Mon:00:00-Mon:03:00"
backup_window = "03:00-06:00"
Expand Down
43 changes: 43 additions & 0 deletions example/mysql-complete/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/mysql-complete/.terraform.tfstate.lock.info
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ID":"d1f3c3ed-270c-c8ad-0f75-7fa01497585e","Operation":"OperationTypeApply","Info":"","Who":"jaihind@jaihind","Version":"1.6.6","Created":"2024-03-22T07:44:03.131426514Z","Path":"terraform.tfstate"}
10 changes: 5 additions & 5 deletions example/mysql-complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ module "mysql" {

engine = "mysql"
engine_version = "8.0.28"
instance_class = "db.m6i.xlarge."
instance_class = "db.m6i.xlarge"
allocated_storage = 5


vpc_id = module.vpc.id
allowed_ip = [module.vpc.vpc_cidr_block]
allowed_ports = [3306]

db_name = "test"
username = "user"
password = "esfsgcGdfawAhdxtfjm!"
port = "3306"
db_name = "test"
username = "user"
manage_master_user_password = true
port = "3306"

maintenance_window = "Mon:00:00-Mon:03:00"
backup_window = "03:00-06:00"
Expand Down
8 changes: 4 additions & 4 deletions example/oracle_db/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ module "oracle" {
storage_encrypted = true
family = "oracle-ee-19"

db_name = "test"
username = "admin"
password = "esfsgcGdfawAhdxtfjm!"
port = "1521"
db_name = "test"
username = "admin"
manage_master_user_password = true
port = "1521"

maintenance_window = "Mon:00:00-Mon:03:00"
backup_window = "03:00-06:00"
Expand Down
43 changes: 43 additions & 0 deletions example/postgreSQL/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions example/postgreSQL/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ module "postgresql" {
storage_encrypted = true
family = "postgres14"

db_name = "test"
username = "dbname"
password = "esfsgcGdfawAhdxtfjm!"
port = "5432"
db_name = "test"
username = "dbname"
manage_master_user_password = true
port = "5432"

maintenance_window = "Mon:00:00-Mon:03:00"
backup_window = "03:00-06:00"
Expand Down
43 changes: 43 additions & 0 deletions example/replica-mysql/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions example/replica-mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module "mysql" {
engine_version = "8.0"
instance_class = "db.t4g.large"
replica_instance_class = "db.t4g.large"
allocated_storage = 20
allocated_storage = 32
identifier = ""
snapshot_identifier = ""
kms_key_id = ""
Expand All @@ -45,7 +45,7 @@ module "mysql" {

db_name = "replica"
username = "replica_mysql"
password = "clkjvnsdikjhdsijfsdli"
password = "cdsjhcjjkxnna5s"

port = 3306
maintenance_window = "Mon:00:00-Mon:03:00"
Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ resource "aws_db_instance" "this" {

db_name = var.db_name
username = local.username
password = local.password
password = var.manage_master_user_password != null ? null : local.password
manage_master_user_password = var.manage_master_user_password
port = var.port
domain = var.domain
domain_iam_role_name = var.domain_iam_role_name
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ variable "password" {
description = "Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file"
}

variable "manage_master_user_password" {
type = bool
default = null
description = "Set to true to allow RDS to manage the master user password in Secrets Manager. Cannot be set if password is provided."
}

variable "port" {
type = string
default = null
Expand Down