-
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
r/aws_secretsmanager_secret_rotation: Fix failing schedule expression updates #31915
r/aws_secretsmanager_secret_rotation: Fix failing schedule expression updates #31915
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.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccSecretsManagerSecretRotation_\|TestAccSecretsManagerSecretRotationDataSource_' PKG=secretsmanager ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/secretsmanager/... -v -count 1 -parallel 2 -run=TestAccSecretsManagerSecretRotation_\|TestAccSecretsManagerSecretRotationDataSource_ -timeout 180m
=== RUN TestAccSecretsManagerSecretRotationDataSource_basic
=== PAUSE TestAccSecretsManagerSecretRotationDataSource_basic
=== RUN TestAccSecretsManagerSecretRotation_basic
=== PAUSE TestAccSecretsManagerSecretRotation_basic
=== RUN TestAccSecretsManagerSecretRotation_scheduleExpression
=== PAUSE TestAccSecretsManagerSecretRotation_scheduleExpression
=== RUN TestAccSecretsManagerSecretRotation_scheduleExpressionHours
=== PAUSE TestAccSecretsManagerSecretRotation_scheduleExpressionHours
=== RUN TestAccSecretsManagerSecretRotation_duration
=== PAUSE TestAccSecretsManagerSecretRotation_duration
=== CONT TestAccSecretsManagerSecretRotationDataSource_basic
=== CONT TestAccSecretsManagerSecretRotation_scheduleExpressionHours
--- PASS: TestAccSecretsManagerSecretRotationDataSource_basic (62.17s)
=== CONT TestAccSecretsManagerSecretRotation_duration
--- PASS: TestAccSecretsManagerSecretRotation_scheduleExpressionHours (79.40s)
=== CONT TestAccSecretsManagerSecretRotation_scheduleExpression
--- PASS: TestAccSecretsManagerSecretRotation_duration (56.44s)
=== CONT TestAccSecretsManagerSecretRotation_basic
--- PASS: TestAccSecretsManagerSecretRotation_scheduleExpression (69.92s)
--- PASS: TestAccSecretsManagerSecretRotation_basic (55.50s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/secretsmanager 179.787s
@szilveszter Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.7.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
Like many others in the linked bug report below I ran into an issue when I wanted to update
rotation_rules.scheduled_expression
attribute of an existingaws_secretsmanager_secret_rotation
resource. For example changing the existing value of"rate(6 hours)"
to"rate(10 hours)"
resulted in the following error message duringterraform apply
:This happens because the AWS API returns a value for the
AutomaticallyAfterDays
attribute underRotationRules
:This is then taken by the provider resource for the update request, which fails the AWS side validation. This change removes that attribute from the state when a schedule expression is present, so that there won't be a conflict during an update. Unfortunately the existing acceptance tests were not covering this case, because for both test steps the schedule expression has the same value, so no update is performed. I tried to address this with the addition of the new test
TestAccSecretsManagerSecretRotation_scheduleExpressionHours
.Relations
Closes #30540.
Relates #30425.
References
N/A
Output from Acceptance Testing