Skip to content

Error: could not start transaction: dial tcp <ip>:5432: connect: connection timed out #257

@vesubramanian

Description

@vesubramanian

Hi,

Please help. I am facing a timeout issue. I have tried my best to provide whatever info required.

Terraform Version

1.1.4

Affected Resource(s)

Please list the resources as a list, for example:

  • postgresql_role (on aurora rds serverless v2 postgresql)

Terraform Configuration Files

  required_providers {
    aws = {
      version = ">= 4.12.0"
    }
    postgresql = { 
      source = "cyrilgdn/postgresql"
      version = "1.15.0"
    }
  }
}

provider "postgresql" {
  scheme   = "awspostgres"
  host     = module.rds-aurora.cluster_endpoint
  port     = module.rds-aurora.cluster_port
  database = "postgres"
  username = var.superuser_name
  password = var.superuser_password
  connect_timeout = 720
  superuser       = false
  expected_version = "13.7"
}

resource "postgresql_role" "pg_roles" {
  for_each           = var.rolelist
  name               = each.key
  login              = true
  password           = each.value
  encrypted_password = true
  #provider = postgresql
  depends_on = [module.rds-aurora]
}.

Expected Behavior

Roles being passed as key value pairs (username & password) should have been created in the cluster/writer instance

Actual Behavior

Error: could not start transaction: dial tcp :5432: connect: connection timed out

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Running on Aurora Serverless v2 Postgresql (Not publicly accessible. Tried with Publicly accessible also, but still same error. However, public access cannot be turned on).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions