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

resource/aws_kms_key: Updates policy and tag propagation time to 5 minutes #20914

Merged
merged 2 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/20914.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_kms_key: Extends timeouts for policy and tag propagation to 5 minutes each
```
8 changes: 5 additions & 3 deletions aws/internal/service/kms/waiter/waiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ const (
KeyDeletedTimeout = 20 * time.Minute
KeyDescriptionPropagationTimeout = 5 * time.Minute
KeyMaterialImportedTimeout = 10 * time.Minute
KeyPolicyPropagationTimeout = 5 * time.Minute
KeyRotationUpdatedTimeout = 10 * time.Minute
KeyStatePropagationTimeout = 20 * time.Minute
KeyTagsPropagationTimeout = 5 * time.Minute
KeyValidToPropagationTimeout = 5 * time.Minute

PropagationTimeout = 2 * time.Minute
Expand Down Expand Up @@ -116,7 +118,7 @@ func KeyPolicyPropagated(conn *kms.KMS, id, policy string) error {
MinTimeout: 1 * time.Second,
}

return tfresource.WaitUntil(PropagationTimeout, checkFunc, opts)
return tfresource.WaitUntil(KeyPolicyPropagationTimeout, checkFunc, opts)
}

func KeyRotationEnabledPropagated(conn *kms.KMS, id string, enabled bool) error {
Expand All @@ -138,7 +140,7 @@ func KeyRotationEnabledPropagated(conn *kms.KMS, id string, enabled bool) error
MinTimeout: 1 * time.Second,
}

return tfresource.WaitUntil(PropagationTimeout, checkFunc, opts)
return tfresource.WaitUntil(KeyRotationUpdatedTimeout, checkFunc, opts)
}

func KeyStatePropagated(conn *kms.KMS, id string, enabled bool) error {
Expand Down Expand Up @@ -208,5 +210,5 @@ func TagsPropagated(conn *kms.KMS, id string, tags keyvaluetags.KeyValueTags) er
MinTimeout: 1 * time.Second,
}

return tfresource.WaitUntil(PropagationTimeout, checkFunc, opts)
return tfresource.WaitUntil(KeyTagsPropagationTimeout, checkFunc, opts)
}
2 changes: 1 addition & 1 deletion aws/resource_aws_kms_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func updateKmsKeyEnabled(conn *kms.KMS, keyID string, enabled bool) error {
return nil, err
}

_, err := tfresource.RetryWhenAwsErrCodeEquals(waiter.KeyRotationUpdatedTimeout, updateFunc, kms.ErrCodeNotFoundException)
_, err := tfresource.RetryWhenAwsErrCodeEquals(waiter.PropagationTimeout, updateFunc, kms.ErrCodeNotFoundException)

if err != nil {
return fmt.Errorf("error updating KMS Key (%s) key enabled (%t): %w", keyID, enabled, err)
Expand Down