Sign in
Menu
Start free trial

Use this module

module "rds_proxy" {
  source = "registry.compliance.tf/terraform-aws-modules/rds-proxy/aws"

  name                   = "rds-proxy"
  iam_role_name          = "rds-proxy-role"
  vpc_subnet_ids         = ["subnet-30ef7b3c", "subnet-1ecda77b", "subnet-ca09ddbc"]
  vpc_security_group_ids = ["sg-f1d03a88"]

  endpoints = {
    read_write = {
      name                   = "read-write-endpoint"
      vpc_subnet_ids         = ["subnet-30ef7b3c", "subnet-1ecda77b", "subnet-ca09ddbc"]
      vpc_security_group_ids = ["sg-f1d03a88"]
    },
    read_only = {
      name                   = "read-only-endpoint"
      vpc_subnet_ids         = ["subnet-30ef7b3c", "subnet-1ecda77b", "subnet-ca09ddbc"]
      vpc_security_group_ids = ["sg-f1d03a88"]
      target_role            = "READ_ONLY"
    }
  }

  auth = {
    "superuser" = {
      description        = "Aurora PostgreSQL superuser password"
      secret_arn         = "arn:aws:secretsmanager:us-east-1:123456789012:secret:superuser-6gsjLD"
    }
  }

  # Target Aurora cluster
  engine_family         = "POSTGRESQL"
  target_db_cluster     = true
  db_cluster_identifier = "my-endpoint"

  tags = {
    Terraform   = "true"
    Environment = "dev"
  }
}

The example from the module's README, with this page's source.

Key inputs

Required inputs first, then the inputs the README example sets.

  • namestring, default ""

    The identifier for the proxy. This name must be unique for all proxies owned by your AWS account in the specified AWS Region. An identifier must begin with a letter and must contain only ASCII letters, digits, and hyphens; it can't end with a hyphen or contain two consecutive hyphens

  • iam_role_namestring, default ""

    The name of the role. If omitted, Terraform will assign a random, unique name

  • vpc_subnet_idslist(string), default []

    One or more VPC subnet IDs to associate with the new proxy

  • vpc_security_group_idslist(string), default []

    One or more VPC security group IDs to associate with the new proxy

  • endpointsmap({...}), default {}

    Map of DB proxy endpoints to create and their attributes

  • authmap({...}), default {...}

    Configuration block(s) with authorization mechanisms to connect to the associated instances or clusters

  • engine_familystring, default ""

    The kind of database engine that the proxy will connect to. Valid values are MYSQL or POSTGRESQL

  • target_db_clusterbool, default false

    Determines whether DB cluster is targeted by proxy

  • db_cluster_identifierstring, default ""

    DB cluster identifier

  • tagsmap(string), default {}

    A map of tags to add to all resources

All 44 inputs