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

Ensure required values are set when changing storage_type. #28847

Merged
merged 15 commits into from
Nov 22, 2024

Conversation

fatmcgav
Copy link
Contributor

Description

As observed in #28589, if changing the storage_type additional fields need to be set if required.

For example, gp3 storage requires that the allocated_storage and iops params are supplied if the volume size is >=400G.

Added a new test case to try and exercise this behaviour, and also tweaked a couple of existing tests to exercise the gp3 tiering behaviour. N.B I've not been able to run these acceptance tests locally yet.

Relations

Fixes #28589

References

Output from Acceptance Testing

N/A

As observed in hashicorp#28589, if changing the `storage_type` additional fields
need to be set if required.

For example, `gp3` storage requires that the `allocated_storage` and `iops`
params are supplied if the volume size is `>=400G`.

Added a new test case to try and exercise this behaviour, and also tweaked
a couple of existing tests to exercise the `gp3` tiering behaviour.
**N.B** I've not been able to run these acceptance tests locally yet.

Fixes hashicorp#28589
@github-actions
Copy link

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 needs-triage Waiting for first response or review from a maintainer. service/rds Issues and PRs that pertain to the rds service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/M Managed by automation to categorize the size of a PR. labels Jan 12, 2023
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 13, 2023
@ewbankkit
Copy link
Contributor

Relates #37257.
Relates #33529.

@YakDriver YakDriver self-assigned this Nov 22, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Nov 22, 2024
@YakDriver YakDriver requested a review from a team as a code owner November 22, 2024 18:05
@@ -3727,79 +3727,6 @@ func TestAccRDSInstance_MonitoringRoleARN_removedToEnabled(t *testing.T) {
})
}

// Regression test for https://github.com/hashicorp/terraform/issues/3760 .
Copy link
Member

Choose a reason for hiding this comment

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

These are just moved to be near the other storage-related tests

YakDriver
YakDriver previously approved these changes Nov 22, 2024
Copy link
Member

@YakDriver YakDriver 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 t T=TestAccRDSInstance_Storage K=rds         
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='TestAccRDSInstance_Storage'  -timeout 360m
2024/11/22 13:57:21 Initializing Terraform AWS Provider...
=== RUN   TestAccRDSInstance_Storage_maxAllocated
=== PAUSE TestAccRDSInstance_Storage_maxAllocated
=== RUN   TestAccRDSInstance_Storage_gp3MySQL
=== PAUSE TestAccRDSInstance_Storage_gp3MySQL
=== RUN   TestAccRDSInstance_Storage_gp3Postgres
=== PAUSE TestAccRDSInstance_Storage_gp3Postgres
=== RUN   TestAccRDSInstance_Storage_gp3SQLServer
=== PAUSE TestAccRDSInstance_Storage_gp3SQLServer
=== RUN   TestAccRDSInstance_Storage_changeThroughput
=== PAUSE TestAccRDSInstance_Storage_changeThroughput
=== RUN   TestAccRDSInstance_Storage_changeIOPSThroughput
=== PAUSE TestAccRDSInstance_Storage_changeIOPSThroughput
=== RUN   TestAccRDSInstance_Storage_changeIOPSGP3
=== PAUSE TestAccRDSInstance_Storage_changeIOPSGP3
=== RUN   TestAccRDSInstance_Storage_throughputSSE
=== PAUSE TestAccRDSInstance_Storage_throughputSSE
=== RUN   TestAccRDSInstance_Storage_postgres
=== PAUSE TestAccRDSInstance_Storage_postgres
=== RUN   TestAccRDSInstance_Storage_changeIOPSio1
=== PAUSE TestAccRDSInstance_Storage_changeIOPSio1
=== RUN   TestAccRDSInstance_Storage_changeIOPSio2
=== PAUSE TestAccRDSInstance_Storage_changeIOPSio2
=== CONT  TestAccRDSInstance_Storage_maxAllocated
=== CONT  TestAccRDSInstance_Storage_changeIOPSGP3
=== CONT  TestAccRDSInstance_Storage_gp3SQLServer
=== CONT  TestAccRDSInstance_Storage_gp3Postgres
=== CONT  TestAccRDSInstance_Storage_changeIOPSio2
=== CONT  TestAccRDSInstance_Storage_postgres
=== CONT  TestAccRDSInstance_Storage_throughputSSE
=== CONT  TestAccRDSInstance_Storage_changeIOPSThroughput
=== CONT  TestAccRDSInstance_Storage_changeThroughput
=== CONT  TestAccRDSInstance_Storage_gp3MySQL
=== CONT  TestAccRDSInstance_Storage_changeIOPSio1
--- PASS: TestAccRDSInstance_Storage_changeIOPSGP3 (538.54s)
--- PASS: TestAccRDSInstance_Storage_changeIOPSio1 (650.44s)
--- PASS: TestAccRDSInstance_Storage_changeIOPSio2 (660.37s)
--- PASS: TestAccRDSInstance_Storage_changeThroughput (660.92s)
--- PASS: TestAccRDSInstance_Storage_changeIOPSThroughput (670.59s)
--- PASS: TestAccRDSInstance_Storage_maxAllocated (684.31s)
--- PASS: TestAccRDSInstance_Storage_gp3MySQL (726.56s)
--- PASS: TestAccRDSInstance_Storage_gp3Postgres (785.79s)
--- PASS: TestAccRDSInstance_Storage_postgres (836.50s)
--- PASS: TestAccRDSInstance_Storage_throughputSSE (1103.82s)
--- PASS: TestAccRDSInstance_Storage_gp3SQLServer (1289.33s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/rds	1293.310s

@@ -0,0 +1,3 @@
```release-note:bug
Copy link
Member

Choose a reason for hiding this comment

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

Forgot on a previous PR.

.changelog/37257.txt Outdated Show resolved Hide resolved
.changelog/28847.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

@YakDriver YakDriver merged commit 042a38f into hashicorp:main Nov 22, 2024
35 checks passed
@github-actions github-actions bot added this to the v5.78.0 milestone Nov 22, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Nov 26, 2024
Copy link

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!

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 Dec 27, 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/M 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]: "aws_db_instance", "storage_type" (io1 > gp3) can't be changed if "allocated_storage" is under 400 GB
4 participants