-
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
aws_opensearch_domain
: Omit IOPS/Throughput when not supported
#28862
Conversation
Community NoteVoting for Prioritization
For Submitters
|
dea601e
to
9d89789
Compare
9d89789
to
e606ed1
Compare
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, couple small things. 🎉
% make testacc PKG=opensearch TESTS=TestAccOpenSearchDomain_VolumeType
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/opensearch/... -v -count 1 -parallel 20 -run='TestAccOpenSearchDomain_VolumeType' -timeout 180m
=== RUN TestAccOpenSearchDomain_VolumeType_update
=== PAUSE TestAccOpenSearchDomain_VolumeType_update
=== RUN TestAccOpenSearchDomain_VolumeType_GP3ToGP2
=== PAUSE TestAccOpenSearchDomain_VolumeType_GP3ToGP2
=== RUN TestAccOpenSearchDomain_VolumeType_missing
=== PAUSE TestAccOpenSearchDomain_VolumeType_missing
=== CONT TestAccOpenSearchDomain_VolumeType_update
=== CONT TestAccOpenSearchDomain_VolumeType_missing
=== CONT TestAccOpenSearchDomain_VolumeType_GP3ToGP2
--- PASS: TestAccOpenSearchDomain_VolumeType_missing (1197.13s)
--- PASS: TestAccOpenSearchDomain_VolumeType_GP3ToGP2 (3983.84s)
--- PASS: TestAccOpenSearchDomain_VolumeType_update (5333.95s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/opensearch 5335.486s
% go test -v ./internal/service/opensearch/... -run ^TestEBS
=== RUN TestEBSVolumeTypePermitsIopsInput
=== PAUSE TestEBSVolumeTypePermitsIopsInput
=== RUN TestEBSVolumeTypePermitsThroughputInput
=== PAUSE TestEBSVolumeTypePermitsThroughputInput
=== CONT TestEBSVolumeTypePermitsIopsInput
=== RUN TestEBSVolumeTypePermitsIopsInput/empty
=== PAUSE TestEBSVolumeTypePermitsIopsInput/empty
=== RUN TestEBSVolumeTypePermitsIopsInput/gp2
=== PAUSE TestEBSVolumeTypePermitsIopsInput/gp2
=== CONT TestEBSVolumeTypePermitsThroughputInput
=== RUN TestEBSVolumeTypePermitsIopsInput/gp3
=== PAUSE TestEBSVolumeTypePermitsIopsInput/gp3
=== RUN TestEBSVolumeTypePermitsThroughputInput/empty
=== RUN TestEBSVolumeTypePermitsIopsInput/io1
=== PAUSE TestEBSVolumeTypePermitsIopsInput/io1
=== RUN TestEBSVolumeTypePermitsIopsInput/standard
=== PAUSE TestEBSVolumeTypePermitsIopsInput/standard
=== PAUSE TestEBSVolumeTypePermitsThroughputInput/empty
=== CONT TestEBSVolumeTypePermitsIopsInput/empty
=== RUN TestEBSVolumeTypePermitsThroughputInput/gp2
=== PAUSE TestEBSVolumeTypePermitsThroughputInput/gp2
=== CONT TestEBSVolumeTypePermitsIopsInput/standard
=== RUN TestEBSVolumeTypePermitsThroughputInput/gp3
=== PAUSE TestEBSVolumeTypePermitsThroughputInput/gp3
=== CONT TestEBSVolumeTypePermitsIopsInput/io1
=== CONT TestEBSVolumeTypePermitsIopsInput/gp3
=== RUN TestEBSVolumeTypePermitsThroughputInput/io1
=== CONT TestEBSVolumeTypePermitsIopsInput/gp2
=== PAUSE TestEBSVolumeTypePermitsThroughputInput/io1
--- PASS: TestEBSVolumeTypePermitsIopsInput (0.00s)
--- PASS: TestEBSVolumeTypePermitsIopsInput/empty (0.00s)
--- PASS: TestEBSVolumeTypePermitsIopsInput/standard (0.00s)
--- PASS: TestEBSVolumeTypePermitsIopsInput/io1 (0.00s)
--- PASS: TestEBSVolumeTypePermitsIopsInput/gp3 (0.00s)
--- PASS: TestEBSVolumeTypePermitsIopsInput/gp2 (0.00s)
=== RUN TestEBSVolumeTypePermitsThroughputInput/standard
=== PAUSE TestEBSVolumeTypePermitsThroughputInput/standard
=== CONT TestEBSVolumeTypePermitsThroughputInput/empty
=== CONT TestEBSVolumeTypePermitsThroughputInput/standard
=== CONT TestEBSVolumeTypePermitsThroughputInput/gp2
=== CONT TestEBSVolumeTypePermitsThroughputInput/io1
=== CONT TestEBSVolumeTypePermitsThroughputInput/gp3
--- PASS: TestEBSVolumeTypePermitsThroughputInput (0.00s)
--- PASS: TestEBSVolumeTypePermitsThroughputInput/empty (0.00s)
--- PASS: TestEBSVolumeTypePermitsThroughputInput/standard (0.00s)
--- PASS: TestEBSVolumeTypePermitsThroughputInput/gp2 (0.00s)
--- PASS: TestEBSVolumeTypePermitsThroughputInput/io1 (0.00s)
--- PASS: TestEBSVolumeTypePermitsThroughputInput/gp3 (0.00s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/opensearch 1.639s
Apply suggestions from code review Co-authored-by: Dirk Avery <31492422+YakDriver@users.noreply.github.com>
This functionality has been released in v4.51.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
This fix prevents the
Throughput
andIops
EBS options from being included in the input struct when the specified volume type does not support them.Specifically, this can happen when a configuration uses a
gp3
volume type without specifyingiops
orthroughput
, then the volume type changes to a type that doesn't support these arguments. On the first apply, the default values set by AWS are written to state. On the subsequent apply these should be omitted from the UpdateDomain request input to avoid aValidationException
.Relations
Closes #27467
References
https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/opensearch@v1.12.0/types#EBSOptions
Output from Acceptance Testing
Output of the new acceptance test prior to the expander changes that confirms the behavior: