Open LowzG opened 2 weeks ago
Voting for Prioritization
Volunteering to Work on This Issue
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
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
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:
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