Skip to content

Conversation

@PabloZaiden
Copy link
Collaborator

📥 Pull Request

❓ What are you trying to address

  • In some cases, while trying to run terraform destroy, there is a pending lock on a Cosmos DB resource that prevents its destruction. Adding a time_sleep helps to mitigate this issue most of the times

✨ Description of new changes

  • Added a time_sleep before destroying the capability host resources

☑️ Checklist

  • 🔍 I have performed a self-review of my own code.
  • 📝 I have commented my code, particularly in hard-to-understand areas.
  • 🧹 I have run the linter and fixed any issues (if applicable).
  • 📄 I have updated the documentation to reflect my changes (if necessary).

Copilot AI review requested due to automatic review settings December 19, 2025 17:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to address Cosmos DB resource locking issues during terraform destroy by adding time_sleep resources to introduce delays. However, the implementation has critical issues with the dependency chain that prevent it from achieving its intended purpose.

Key changes:

  • Added hashicorp/time provider dependency with version constraint ~> 0.13
  • Introduced two time_sleep resources with 60-second destroy durations
  • Updated project module dependencies to include the time_sleep resources
  • Updated README documentation to reflect the new resources and provider

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
reference_architectures/foundry_standard/terraform.tf Added time provider configuration with version constraint ~> 0.13
reference_architectures/foundry_standard/main.tf Added two time_sleep resources and updated depends_on for both projects to reference them
reference_architectures/foundry_standard/README.md Updated provider and resource tables to include time provider and time_sleep resources

Copy link
Contributor

@bsherwin bsherwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider if we should be explicit on the "create_duration" and not just put the "destroy_duration"

@PabloZaiden PabloZaiden merged commit 1cd9d36 into microsoft:main Dec 19, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants