Skip to content

DB Module

Description

This module creates an RDS instance, a KMS key, a DB subnet group, a DB parameter group, a DB proxy, and an IAM role for the DB proxy.

Usage

module "db" {
  source = "./modules/db"
  product = "oqtopus"
  org = "example"
  env = "dev"
  db_name = "main"
  user_name = "admin"
  subnet_ids = ["subnet-123"]
  db_security_group_ids = ["sg-123"]
  db_proxy_security_group_ids = ["sg-123"]
}

Requirements

Name Version
terraform >= 1.9.0, < 2.0.0
aws ~> 5.57.0

Providers

Name Version
aws ~> 5.57.0

Resources

Name Type
aws_db_instance.this resource
aws_db_parameter_group.this resource
aws_db_proxy.this resource
aws_db_proxy_default_target_group.this resource
aws_db_proxy_target.this resource
aws_db_subnet_group.this resource
aws_iam_policy.db_proxy resource
aws_iam_role.db_proxy resource
aws_iam_role_policy_attachment.db_proxy resource
aws_kms_key.db_performance_insights resource
aws_kms_key.db_storage resource
aws_iam_policy_document.db_proxy data source
aws_iam_policy_document.db_proxy_assume_role data source

Inputs

Name Description Type Default Required
db_name The name of the database string n/a yes
db_performance_insights_enabled DB performance insights enabled bool n/a yes
db_proxy_security_group_ids The security group IDs for the RDS proxy list(string) n/a yes
db_security_group_ids The security group IDs for the RDS instance list(string) n/a yes
env environment name string n/a yes
org organization name string n/a yes
product product name string n/a yes
region region of the deployment string n/a yes
subnet_ids The subnet IDs for the RDS instance list(string) n/a yes
user_name The name of the user string n/a yes

Outputs

Name Description
db_proxy_endpoint The endpoint of the RDS proxy
db_secret_arn The ARN of the secret for the RDS instance