cyrilgdn / terraform-provider-postgresql

Terraform PostgreSQL provider
https://www.terraform.io/docs/providers/postgresql/
Mozilla Public License 2.0
355 stars 180 forks source link

aws_rds_iam_region is not set when aws_rds_iam_profile is set #444

Open azban opened 3 weeks ago

azban commented 3 weeks ago

Terraform Version

1.22.0

Affected Resource(s)

provider configuration with aws_iam_auth

Terraform Configuration Files

provider "postgresql" {
  host = local.host
  port = 5432
  aws_rds_iam_auth = true
  aws_rds_iam_region = "us-east-2"
  aws_rds_iam_profile = "admin"
  superuser = false
}

resource "postgresql_role" "user" {
  name  = "user"
  login = true
}

Expected Behavior

when a profile and a region are set, the region should override the profile value when getting an RDS auth token. i found this because i didn't have a region set in a profile and i was getting authentication failures, but i imagine there are also cases where you want to set a default region, but have the option to override.

Actual Behavior

the region is not passed into the aws config object if the profile name is set.

Steps to Reproduce

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

  1. terraform apply