-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
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
…orage-change-fix-36648
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.
Looks good 🎉
% make t T=TestAccRDSCluster_storageTypeGeneralPurposeToProvisionedIops K=rds
make: go1.23.3 not found
make: installing go1.23.3...
make: if you get an error, see https://go.dev/doc/manage-install to locally install various Go versions
go: downloading golang.org/dl v0.0.0-20241106222207-4e0968199959
Downloaded 0.0% ( 16384 / 71639942 bytes) ...
Downloaded 17.8% (12763072 / 71639942 bytes) ...
Downloaded 100.0% (71639942 / 71639942 bytes)
Unpacking /Users/dirk/sdk/go1.23.3/go1.23.3.darwin-arm64.tar.gz ...
Success. You may now run 'go1.23.3'
make: go1.23.3 ready
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/rds/... -v -count 1 -parallel 20 -run='TestAccRDSCluster_storageTypeGeneralPurposeToProvisionedIops' -timeout 360m
go: downloading github.com/aws/aws-sdk-go-v2/service/apigateway v1.28.0
go: downloading github.com/aws/aws-sdk-go-v2/service/applicationautoscaling v1.34.0
go: downloading github.com/aws/aws-sdk-go-v2/service/appsync v1.40.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudfront v1.43.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudtrail v1.46.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.44.0
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.44.0
go: downloading github.com/aws/aws-sdk-go-v2/service/dlm v1.28.7
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.193.0
go: downloading github.com/aws/aws-sdk-go-v2/service/elasticache v1.44.0
go: downloading github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 v1.42.1
go: downloading github.com/aws/aws-sdk-go-v2/service/iot v1.61.0
go: downloading github.com/aws/aws-sdk-go-v2/service/lambda v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/polly v1.45.7
go: downloading github.com/aws/aws-sdk-go-v2/service/resiliencehub v1.28.0
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ssm v1.56.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ssmquicksetup v1.3.0
go: downloading github.com/aws/aws-sdk-go-v2/service/xray v1.30.0
go: downloading github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.40
2024/11/22 09:58:11 Initializing Terraform AWS Provider...
=== RUN TestAccRDSCluster_storageTypeGeneralPurposeToProvisionedIops
=== PAUSE TestAccRDSCluster_storageTypeGeneralPurposeToProvisionedIops
=== CONT TestAccRDSCluster_storageTypeGeneralPurposeToProvisionedIops
--- PASS: TestAccRDSCluster_storageTypeGeneralPurposeToProvisionedIops (1084.15s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/rds 1088.267s
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.
LGTM 🚀
This functionality has been released in v5.78.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! |
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. |
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