-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Fix RDS instance bug where switching to IO2 from GP needs the allocated storage set #37257
base: main
Are you sure you want to change the base?
Fix RDS instance bug where switching to IO2 from GP needs the allocated storage set #37257
Conversation
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @nhenjes 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
nhenjes Thank you for your contribution, can you also add a test for this? |
@DrFaust92 I can work on writing a test for this |
2509a7f
to
77375f7
Compare
@DrFaust92 I was able to get my test working properly now. The test will provision a cluster using GP3 at 400GB with 12000 provisioned IOPs then updates to IO2 successfully. Without the bug fix, the same test reports Error: updating RDS DB Instance (terraform-20240517150000387300000001): operation error RDS: ModifyDBInstance, https response error StatusCode: 400, RequestID: b15c2fa4-e202-4778-a85f-09f34ce77dcc, api error InvalidParameterCombination: You must specify both the storage size and iops when modifying the storage size or iops on a DB instance that has iops.
with aws_db_instance.test,
on terraform_plugin_test.tf line 56, in resource "aws_db_instance" "test":
56: resource "aws_db_instance" "test" { |
77375f7
to
7109377
Compare
7109377
to
2ca05fd
Compare
Description
When creating an RDS instance, the Allocated Storage param is passed correctly to AWS. When going from, for example, GP3 to IO2 on an existing instance only a change in the Storage Type is detected by the provider and only Storage Type is passed. AWS' API however, requires that both storage type and Allocated Storage are submitted as part of the request
Relations
Closes #36648.
Relates (closes?) #28589.
References
When running
aws rds modify-db-instance --db-instance-identifier <db-name> --storage-type io2 --iops 3000
the following error is thrownWhen running
aws rds modify-db-instance --db-instance-identifier <db-name> --storage-type io2 --iops 3000 --allocated-storage 100
The result is a successful change
Subsequent runs with the same params result in success meaning passing the allocated storage again is perfectly fine
Output from Acceptance Testing