Skip to content

TF module to create a Schema on RDS Aurora and generate random username and password and write to a secret.

License

Notifications You must be signed in to change notification settings

Lupus-Metallum/terraform-aws-rds-schema-and-user

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

terraform-aws-rds-schema-and-user

TF module to create a Schema on RDS Aurora and generate random username and password and write to a secret.

Example usage:

module "rds" {
  source   = "../rds"

  rds_name              = "example-schema"
  rds_cluster_host      = var.rds_cluster_host
  rds_cluster_name      = var.rds_cluster_name
  rds_cluster_port      = var.rds_cluster_port
  default_character_set = "utf8mb4"
  default_collation     = "utf8mb4_unicode_ci"

  tags = var.tags
}

Requirements

Name Version
terraform >= 0.13

Providers

Name Version
aws n/a
mysql n/a
random n/a

Resources

Name Type
aws_secretsmanager_secret.dbsecret resource
aws_secretsmanager_secret_version.dbsecretvalue resource
mysql_database.db_schema resource
mysql_grant.db_user_grant resource
mysql_user.db_username resource
random_password.db_user_pass resource
random_string.db_user resource

Inputs

Name Description Type Default Required
rds_cluster_host The shared DB cluster DNS hostname that this tenant runs on string n/a yes
rds_cluster_name The shared DB cluster that this tenant runs on string n/a yes
rds_cluster_port The shared DB cluster port that this tenant runs on string n/a yes
rds_name The Name of the Tenant to embed in resouces string n/a yes
tags default map of tags map(string) n/a yes
default_character_set The default character set to apply to the schema string "utf8" no
default_collation The default collation to apply to the schema string "utf8_general_ci" no

Outputs

Name Description
secret_arn n/a
secret_name n/a