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

r/aws_db_instance: Handle InvalidParameterCombination: A parameter group can't be specified during Read Replica creation for the following DB engine: postgres #38227

Merged

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jul 2, 2024

Description

See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html#USER_ReadRepl.XRgn.Cnsdr.
Because engine isn't configured for read replicas we can't switch on it and introduce conditional logic. Instead modify API input and retry on InvalidParameterCombination: A parameter group can't be specified during Read Replica creation for the following DB engine: postgres errors.

Relations

Closes #38056.
Relates #36080.

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccRDSInstance_ReplicateSourceDB_\|estAccRDSInstance_basic' PKG=rds ACCTEST_PARALLELISM=3
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 3  -run=TestAccRDSInstance_ReplicateSourceDB_\|estAccRDSInstance_basic -timeout 360m
=== RUN   TestAccRDSInstance_basic
=== PAUSE TestAccRDSInstance_basic
=== RUN   TestAccRDSInstance_ReplicateSourceDB_basic
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_basic
=== RUN   TestAccRDSInstance_ReplicateSourceDB_namePrefix
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_namePrefix
=== RUN   TestAccRDSInstance_ReplicateSourceDB_nameGenerated
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_nameGenerated
=== RUN   TestAccRDSInstance_ReplicateSourceDB_addLater
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_addLater
=== RUN   TestAccRDSInstance_ReplicateSourceDB_allocatedStorage
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_allocatedStorage
=== RUN   TestAccRDSInstance_ReplicateSourceDB_iops
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_iops
=== RUN   TestAccRDSInstance_ReplicateSourceDB_allocatedStorageAndIops
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_allocatedStorageAndIops
=== RUN   TestAccRDSInstance_ReplicateSourceDB_allowMajorVersionUpgrade
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_allowMajorVersionUpgrade
=== RUN   TestAccRDSInstance_ReplicateSourceDB_autoMinorVersionUpgrade
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_autoMinorVersionUpgrade
=== RUN   TestAccRDSInstance_ReplicateSourceDB_availabilityZone
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_availabilityZone
=== RUN   TestAccRDSInstance_ReplicateSourceDB_backupRetentionPeriod
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_backupRetentionPeriod
=== RUN   TestAccRDSInstance_ReplicateSourceDB_backupWindow
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_backupWindow
=== RUN   TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupName
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupName
=== RUN   TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupNameRAMShared
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupNameRAMShared
=== RUN   TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupNameVPCSecurityGroupIDs
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupNameVPCSecurityGroupIDs
=== RUN   TestAccRDSInstance_ReplicateSourceDB_deletionProtection
    instance_test.go:1492: CreateDBInstanceReadReplica API currently ignores DeletionProtection=true with SourceDBInstanceIdentifier set
--- SKIP: TestAccRDSInstance_ReplicateSourceDB_deletionProtection (0.00s)
=== RUN   TestAccRDSInstance_ReplicateSourceDB_iamDatabaseAuthenticationEnabled
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_iamDatabaseAuthenticationEnabled
=== RUN   TestAccRDSInstance_ReplicateSourceDB_maintenanceWindow
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_maintenanceWindow
=== RUN   TestAccRDSInstance_ReplicateSourceDB_maxAllocatedStorage
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_maxAllocatedStorage
=== RUN   TestAccRDSInstance_ReplicateSourceDB_monitoring
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_monitoring
=== RUN   TestAccRDSInstance_ReplicateSourceDB_monitoring_sourceAlreadyExists
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_monitoring_sourceAlreadyExists
=== RUN   TestAccRDSInstance_ReplicateSourceDB_multiAZ
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_multiAZ
=== RUN   TestAccRDSInstance_ReplicateSourceDB_networkType
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_networkType
=== RUN   TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameSameSetOnBoth
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameSameSetOnBoth
=== RUN   TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameDifferentSetOnBoth
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameDifferentSetOnBoth
=== RUN   TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameReplicaCopiesValue
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameReplicaCopiesValue
=== RUN   TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameSetOnReplica
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameSetOnReplica
=== RUN   TestAccRDSInstance_ReplicateSourceDB_port
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_port
=== RUN   TestAccRDSInstance_ReplicateSourceDB_vpcSecurityGroupIDs
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_vpcSecurityGroupIDs
=== RUN   TestAccRDSInstance_ReplicateSourceDB_caCertificateIdentifier
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_caCertificateIdentifier
=== RUN   TestAccRDSInstance_ReplicateSourceDB_characterSet_Source
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_characterSet_Source
=== RUN   TestAccRDSInstance_ReplicateSourceDB_characterSet_Replica
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_characterSet_Replica
=== RUN   TestAccRDSInstance_ReplicateSourceDB_replicaMode
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_replicaMode
=== RUN   TestAccRDSInstance_ReplicateSourceDB_parameterGroupTwoStep
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_parameterGroupTwoStep
=== RUN   TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNameEquivalent
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNameEquivalent
=== RUN   TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNamePostgres
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNamePostgres
=== RUN   TestAccRDSInstance_ReplicateSourceDB_CrossRegion_characterSet
    instance_test.go:2261: Skipping due to upstream error
--- SKIP: TestAccRDSInstance_ReplicateSourceDB_CrossRegion_characterSet (0.00s)
=== RUN   TestAccRDSInstance_ReplicateSourceDB_performanceInsightsEnabled
=== PAUSE TestAccRDSInstance_ReplicateSourceDB_performanceInsightsEnabled
=== CONT  TestAccRDSInstance_basic
=== CONT  TestAccRDSInstance_ReplicateSourceDB_monitoring
=== CONT  TestAccRDSInstance_ReplicateSourceDB_vpcSecurityGroupIDs
--- PASS: TestAccRDSInstance_basic (494.94s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_availabilityZone
--- PASS: TestAccRDSInstance_ReplicateSourceDB_monitoring (1569.06s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_maxAllocatedStorage
--- PASS: TestAccRDSInstance_ReplicateSourceDB_vpcSecurityGroupIDs (1601.96s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_maintenanceWindow
--- PASS: TestAccRDSInstance_ReplicateSourceDB_availabilityZone (1700.93s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_iamDatabaseAuthenticationEnabled
--- PASS: TestAccRDSInstance_ReplicateSourceDB_maintenanceWindow (1496.84s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupNameVPCSecurityGroupIDs
--- PASS: TestAccRDSInstance_ReplicateSourceDB_maxAllocatedStorage (1557.27s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupNameRAMShared
    instance_test.go:1442: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupNameRAMShared (0.00s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupName
--- PASS: TestAccRDSInstance_ReplicateSourceDB_iamDatabaseAuthenticationEnabled (1559.07s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_backupWindow
--- PASS: TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupName (1760.60s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_backupRetentionPeriod
--- PASS: TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupNameVPCSecurityGroupIDs (1811.03s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_allocatedStorage
--- PASS: TestAccRDSInstance_ReplicateSourceDB_backupWindow (1619.49s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_autoMinorVersionUpgrade
--- PASS: TestAccRDSInstance_ReplicateSourceDB_allocatedStorage (1455.50s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_allowMajorVersionUpgrade
--- PASS: TestAccRDSInstance_ReplicateSourceDB_backupRetentionPeriod (1619.81s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_allocatedStorageAndIops
--- PASS: TestAccRDSInstance_ReplicateSourceDB_autoMinorVersionUpgrade (1567.99s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_iops
--- PASS: TestAccRDSInstance_ReplicateSourceDB_allowMajorVersionUpgrade (1549.08s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_nameGenerated
--- PASS: TestAccRDSInstance_ReplicateSourceDB_allocatedStorageAndIops (1700.07s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_addLater
--- PASS: TestAccRDSInstance_ReplicateSourceDB_iops (1568.80s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_parameterGroupTwoStep
--- PASS: TestAccRDSInstance_ReplicateSourceDB_nameGenerated (1377.92s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_performanceInsightsEnabled
--- PASS: TestAccRDSInstance_ReplicateSourceDB_addLater (1103.17s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNamePostgres
--- PASS: TestAccRDSInstance_ReplicateSourceDB_parameterGroupTwoStep (2150.09s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNameEquivalent
--- PASS: TestAccRDSInstance_ReplicateSourceDB_performanceInsightsEnabled (1591.16s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_characterSet_Replica
--- PASS: TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNamePostgres (2147.14s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_replicaMode
--- PASS: TestAccRDSInstance_ReplicateSourceDB_characterSet_Replica (1621.04s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameDifferentSetOnBoth
--- PASS: TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNameEquivalent (2064.58s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_port
--- PASS: TestAccRDSInstance_ReplicateSourceDB_replicaMode (1382.04s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameSetOnReplica
--- PASS: TestAccRDSInstance_ReplicateSourceDB_port (334.62s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameReplicaCopiesValue
--- PASS: TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameDifferentSetOnBoth (739.67s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_networkType
--- PASS: TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameReplicaCopiesValue (1522.87s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameSameSetOnBoth
--- PASS: TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameSetOnReplica (838.08s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_namePrefix
--- PASS: TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameSameSetOnBoth (1766.67s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_basic
--- PASS: TestAccRDSInstance_ReplicateSourceDB_basic (1786.42s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_multiAZ
--- PASS: TestAccRDSInstance_ReplicateSourceDB_multiAZ (2162.38s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_characterSet_Source
--- PASS: TestAccRDSInstance_ReplicateSourceDB_characterSet_Source (2776.89s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_caCertificateIdentifier
--- PASS: TestAccRDSInstance_ReplicateSourceDB_caCertificateIdentifier (1884.57s)
=== CONT  TestAccRDSInstance_ReplicateSourceDB_monitoring_sourceAlreadyExists
--- PASS: TestAccRDSInstance_ReplicateSourceDB_monitoring_sourceAlreadyExists (1714.55s)
--- PASS: TestAccRDSInstance_ReplicateSourceDB_namePrefix (1409.16s)
--- PASS: TestAccRDSInstance_ReplicateSourceDB_networkType (1732.53s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	13754.236s

@ewbankkit ewbankkit requested a review from a team as a code owner July 2, 2024 17:43
Copy link

github-actions bot commented Jul 2, 2024

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/rds Issues and PRs that pertain to the rds service. labels Jul 2, 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 Jul 2, 2024
@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Jul 2, 2024
@ewbankkit ewbankkit changed the title [WIP] r/aws_db_instance: Handle InvalidParameterCombination: A parameter group can't be specified during Read Replica creation for the following DB engine: postgres r/aws_db_instance: Handle InvalidParameterCombination: A parameter group can't be specified during Read Replica creation for the following DB engine: postgres Jul 3, 2024
@ewbankkit
Copy link
Contributor Author

% 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
--- PASS: TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNamePostgres (2232.66s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	2237.375s

Copy link
Contributor

@nam054 nam054 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

% 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
--- PASS: TestAccRDSInstance_ReplicateSourceDB_CrossRegion_parameterGroupNamePostgres (2562.93s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	2568.834s

@ewbankkit ewbankkit merged commit 3a10ac6 into main Jul 9, 2024
38 checks passed
@ewbankkit ewbankkit deleted the b-aws_db_instance-read-replica-parameter-group-postgres branch July 9, 2024 17:07
@github-actions github-actions bot added this to the v5.58.0 milestone Jul 9, 2024
terraform-aws-provider bot pushed a commit that referenced this pull request 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!

Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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