Skip to content

r/aws_kms_replica_key: Add configurable create timeout - #49917

Open
shashankvarma499 wants to merge 2 commits into
hashicorp:mainfrom
shashankvarma499:fix/kms-replica-key-create-timeout
Open

r/aws_kms_replica_key: Add configurable create timeout#49917
shashankvarma499 wants to merge 2 commits into
hashicorp:mainfrom
shashankvarma499:fix/kms-replica-key-create-timeout

Conversation

@shashankvarma499

@shashankvarma499 shashankvarma499 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #49915.

The aws_kms_replica_key create path waits for the replica key to leave Creating and reach Enabled using a hardcoded 2 minute timeout (waitReplicaKeyCreated). Multi-Region key replication routinely takes longer than that, roughly 10 minutes for us-east-1 to eu-central-1 in the reported case, so the create reliably fails even though AWS goes on to finish creating the replica successfully.

This change adds a timeouts block with a configurable create timeout, defaulting to 20 minutes, and wires it into waitReplicaKeyCreated. Users replicating across slower regions can now raise the timeout instead of the create failing every time.

Relations

This addresses the hardcoded 2 minute wait described in #49915. The other two symptoms reported there, the tainted-resource ReplicateKey AlreadyExistsException path and updateKeyEnabled not retrying KMSInvalidStateException, are left for separate follow-ups so this change stays focused.

References

The create path waited for the replica key to leave Creating and reach Enabled using a hardcoded 2 minute timeout. Multi-Region key replication routinely takes longer than that, so add a timeouts block with a configurable create timeout (default 20 minutes) and wire it into the wait.

Signed-off-by: Shashank Varma <324153016+shashankvarma499@users.noreply.github.com>
@shashankvarma499
shashankvarma499 requested a review from a team as a code owner September 9, 2026 16:37
Signed-off-by: Shashank Varma <324153016+shashankvarma499@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • 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 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

@github-actions github-actions Bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. service/kms Issues and PRs that pertain to the kms service. size/XS Managed by automation to categorize the size of a PR. labels Sep 9, 2026
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. timeouts Pertains to timeout increases. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. service/kms Issues and PRs that pertain to the kms service. size/XS Managed by automation to categorize the size of a PR. timeouts Pertains to timeout increases.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: aws_kms_replica_key: create fails after a hardcoded 2m wait for 'Enabled', and no apply path converges until AWS finishes replicating

2 participants