-
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
resource/aws_elasticache_parameter_group: Handle API reset issues with reserved-memory parameter #6752
resource/aws_elasticache_parameter_group: Handle API reset issues with reserved-memory parameter #6752
Conversation
…sues with reserved-memory parameter where possible The Elasticache API is currently always returning an `InternalFailure` when attempting to reset the `reserved-memory` parameter. The resource previously provided an uphelpful timeout error with no way to workaround the behavior to properly update `reserved-memory` to a new value or switch to the `reserved-memory-percentage` parameter. The resource now employs some handling to skip the `reserved-memory` reset, but only after its attempted before in case the Elasticache API is fixed in the future. Changes: * resource/aws_elasticache_parameter_group: Code and acceptance test workarounds for `reserved-memory` parameter always returning an error during update * tests/resource/aws_elasticache_parameter_group: Switch from bespoke import test to always testing import * tests/resource/aws_elasticache_parameter_group: Other minor refactoring to clean acceptance testing Previously failing acceptance testing: ``` --- FAIL: TestAccAWSElasticacheParameterGroup_removeReservedMemoryParameter (76.81s) testing.go:538: Step 1 error: Error applying: 1 error occurred: * aws_elasticache_parameter_group.bar: 1 error occurred: * aws_elasticache_parameter_group.bar: Error resetting Cache Parameter Group: timeout while waiting for state to become 'success' (timeout: 30s) --- FAIL: TestAccAWSElasticacheParameterGroup_updateReservedMemoryParameter (76.81s) testing.go:538: Step 1 error: Error applying: 1 error occurred: * aws_elasticache_parameter_group.bar: 1 error occurred: * aws_elasticache_parameter_group.bar: Error resetting Cache Parameter Group: timeout while waiting for state to become 'success' (timeout: 30s) --- FAIL: TestAccAWSElasticacheParameterGroup_switchReservedMemoryParameter (77.01s) testing.go:538: Step 1 error: Error applying: 1 error occurred: * aws_elasticache_parameter_group.bar: 1 error occurred: * aws_elasticache_parameter_group.bar: Error resetting Cache Parameter Group: timeout while waiting for state to become 'success' (timeout: 30s) ``` Output from acceptance testing: ``` --- PASS: TestAccAWSElasticacheParameterGroup_basic (19.94s) --- PASS: TestAccAWSElasticacheParameterGroup_UppercaseName (23.09s) --- PASS: TestAccAWSElasticacheParameterGroup_Description (33.43s) --- PASS: TestAccAWSElasticacheParameterGroup_addParameter (34.66s) --- PASS: TestAccAWSElasticacheParameterGroup_removeAllParameters (43.51s) --- PASS: TestAccAWSElasticacheParameterGroup_removeReservedMemoryParameter (43.57s) --- PASS: TestAccAWSElasticacheParameterGroup_updateReservedMemoryParameter (86.12s) --- PASS: TestAccAWSElasticacheParameterGroup_switchReservedMemoryParameter (95.82s) ```
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 with some minor comments
} | ||
} | ||
|
||
if !tryReservedMemoryPercentageWorkaround { |
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.
I think we can remove this bit. I only see it becoming false on line 230 and we break there.
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.
That break
is for the inner for loop. We need this boolean to determine the rest of this flow.
|
||
// The reserved-memory-percentage parameter does not exist in redis2.6 and redis2.8 | ||
family := d.Get("family").(string) | ||
if family == "redis2.6" || family == "redis2.8" { |
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.
We should add a log here or I'm even tempted to error out if this value has changed while using this family
if family == "redis2.6" || family == "redis2.8" { | |
log.Printf("[WARN] unable to update `reserved-memory-percentage` while family is %q: %s", family, err) | |
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.
I'll add a warning log in there 👍
…d-memory parameter reset with redis2.6 and redis2.8
This has been released in version 1.52.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
The Elasticache API is currently always returning an
InternalFailure
error when attempting to reset thereserved-memory
parameter. The Terraform resource previously provided an unhelpful timeout error with no way to workaround the behavior to properly updatereserved-memory
to a new value or switch to thereserved-memory-percentage
parameter.The resource now employs some handling to skip the problematic
reserved-memory
reset, but only after its attempted before, in case the Elasticache API is fixed in the future.Changes:
reserved-memory
parameter always returning an error during updatePreviously failing acceptance testing:
Output from acceptance testing: