Skip to content

Error connecting to aws aurora db (postgres) #79

@dc-95

Description

@dc-95

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

Terraform v1.0.7
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v4.28.0
+ provider registry.terraform.io/paultyng/sql v0.4.0

Your version of Terraform is out of date! The latest version
is 1.2.9. You can update by downloading from https://www.terraform.io/downloads.html```
### Affected Resource(s)
Please list the resources as a list, for example:
provider "sql" {
  alias = "postgres"
  url   = var.db_connection_string
}

data "sql_query" "create_audit_role" {
  provider = sql.postgres
  query = var.create_audit_role_query
}

data "sql_query" "create_extension" {
  provider = sql.postgres
  query = var.create_pgaudit_extension
}

data "sql_query" "alter_db_audit" {
  provider = sql.postgres
  query = "set pgaudit.log='All';"
  depends_on = [
    data.sql_query.create_audit_role,
    data.sql_query.create_extension
  ]
}

Expected Behavior

Supposed to connect and run sql query

Actual Behavior

Received:

Error: Plugin error
│ 
│   with provider["registry.terraform.io/paultyng/sql"].postgres,
│   on main.tf line 1, in provider "sql":
│    1: provider "sql" {
│ 
│ The plugin returned an unexpected error from plugin.(*GRPCProvider).ConfigureProvider: rpc error: code = Unknown desc =
│ ConfigureProvider - unable to ping database: failed to connect to `host=test.cluster-asdafascads.us-east-1.rds.amazonaws.com
│ user=postgres database=postgrestest`: dial error (dial tcp xx.xxx.xxx.xxx:5432: connect: operation timed out)

Steps to Reproduce

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

  1. terraform init
  2. terraform plan

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