Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Issues setting custom parameter group on cross-region RDS Read Replica with Postgres engine #38056

Closed
LowzG opened this issue Jun 20, 2024 · 4 comments · Fixed by #38227
Assignees
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/rds Issues and PRs that pertain to the rds service.
Milestone

Comments

@LowzG
Copy link

LowzG commented Jun 20, 2024

Terraform Core Version

1.8.5

AWS Provider Version

5.51.1

Affected Resource(s)

aws_db_instance

Expected Behavior

Creating an RDS cross-region read replica with Postgres engine and custom parameter group should succeed

Actual Behavior

The following error message is produced
Error: creating RDS DB Instance (read replica) (replica-ap-northeast-1): InvalidParameterCombination: A parameter group can't be specified during Read Replica creation for the following DB engine: postgres status code: 400, request id: ffff3ef0-274f-4e7f-ac74-04d06e8c5256

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_db_instance" "replica-ap-northeast-1" {
  identifier             = "replica-ap-northeast-1"
  replicate_source_db    = "arn:aws:rds:us-east-2:*"
  instance_class         = "db.m7g.large"
  engine                 = "postgres"
  apply_immediately      = true
  skip_final_snapshot    = true
  vpc_security_group_ids = [local.vpc_id]
  parameter_group_name   = "custom-parameter-group"
}

Steps to Reproduce

terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

In this PR a change was introduced to set the parameter group of a cross-region read replica at time of creation as opposed to a modification task handled after the instance has been created.

That seems to work well for instances of Oracle engines, but not Postgres. AWS documentation seem to indicate that setting the custom parameter group on a read replica at time of creation can only be done on instances with Oracle or MySQL engines:

For the MySQL and Oracle DB engines, you can specify a custom parameter group for the read replica in the --db-parameter-group-name option of the AWS CLI command create-db-instance-read-replica. You can't specify a custom parameter group when you use the AWS Management Console.

I think the correct approach were may be to continue to set the parameter group at creation for Oracle/MySQL engines, and all others should happen after the instance is created as part of a modify task: https://github.com/hashicorp/terraform-provider-aws/blob/v5.54.1/internal/service/rds/instance.go#L932-L940

References

No response

Would you like to implement a fix?

None

@LowzG LowzG added the bug Addresses a defect in current functionality. label Jun 20, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/rds Issues and PRs that pertain to the rds service. label Jun 20, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jun 20, 2024
@justinretzolk justinretzolk added regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 27, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jun 27, 2024
@ewbankkit ewbankkit self-assigned this Jun 28, 2024
@ewbankkit
Copy link
Contributor

I can reproduce this with a new acceptance test:

% make testacc TESTARGS='-run=TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNamePostgres' PKG=rds
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.4 test ./internal/service/rds/... -v -count 1 -parallel 20  -run=TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNamePostgres -timeout 360m
=== RUN   TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNamePostgres
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNamePostgres
=== CONT  TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNamePostgres
    instance_test.go:2229: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating RDS DB Instance (read replica) (tf-acc-test-6875571257136664753): InvalidParameterCombination: A parameter group can't be specified during Read Replica creation for the following DB engine: postgres
        	status code: 400, request id: 3f8dfe34-170c-4bda-8768-7214fbd737b9
        
          with aws_db_instance.test,
          on terraform_plugin_test.tf line 32, in resource "aws_db_instance" "test":
          32: resource "aws_db_instance" "test" {
        
--- FAIL: TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNamePostgres (829.42s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/rds	833.974s
FAIL
make: *** [testacc] Error 1

Copy link

github-actions bot commented Jul 9, 2024

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.58.0 milestone Jul 9, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jul 12, 2024
Copy link

This functionality has been released in v5.58.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
3 participants