terraform-aws-modules/terraform-aws-rds-proxy

Issue applying with latest release version

clowe-r7 opened this issue · 4 comments

Description

When creating a Proxy that works with a RDS Postgres instance, I receive the following error
╷ │ Error: only lowercase alphanumeric characters and hyphens allowed in "db_instance_identifier" │ │ with module.rds_proxy.aws_db_proxy_target.db_instance[0], │ on ../../main.tf line 63, in resource "aws_db_proxy_target" "db_instance": │ 63: db_instance_identifier = var.db_instance_identifier
I was able to reproduce this both in my configuration and the example configuration provided for postgres-iam-isntance. I was able to resolve this in my configuration by using the identifier attribute instead of the id of the RDS instance resource

Versions

  • Module version [Required]:

  • Terraform version:
    1.4.5

  • Provider version(s):

  • provider registry.terraform.io/hashicorp/aws v5.1.0
  • provider registry.terraform.io/hashicorp/random v3.5.1

Reproduction Code [Required]

Was able to reproduce by running a terraform plan && terraform apply using the postgres-iam-instance example module provided.

Steps to reproduce the behavior:
Run a terraform plan & apply on the postgres-iam-instance example module provided

Expected behavior

Successful terraform apply

Actual behavior

Terraform failed to apply with an error message.

Terminal Output Screenshot(s)

image

Update. It seems the RDS DB identifier changed with the release of AWS provider version 5 here https://github.com/hashicorp/terraform-provider-aws/blob/372774f3b890dc7d7222026810f9b1b335f86575/internal/service/rds/instance.go#L37

Eroyi commented

For anyone facing the same issue, by changing the Line 88 at ./example/postgres-iam-instance into db_instance_identifier = local.name can temporary patch this error.

But please be aware, if you are creating Proxy with existing RDS, you'll have to specify the name of the database in arg local.name

I believe this is resolved now - if not, please let me know

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.