Skip to content

feat(dummy): add new controls for the destroy phase#1144

Open
frmadem wants to merge 11 commits into
mainfrom
feat/1143-dummy-add-crash-and-sleep-on-destroy
Open

feat(dummy): add new controls for the destroy phase#1144
frmadem wants to merge 11 commits into
mainfrom
feat/1143-dummy-add-crash-and-sleep-on-destroy

Conversation

@frmadem
Copy link
Copy Markdown
Contributor

@frmadem frmadem commented Mar 31, 2026

Adds destroy-phase controls to the modules/dummy Terraform module so CI/CD pipelines can simulate slow or failing terraform destroy runs, and brings the module into conformance with the repository CONTRIBUTING.md guide.

Changes Made

  • CRLF fix: Normalized line endings in modules/dummy/main.tf to LF.
  • Input validation: Added a validation block to sleep_on_destroy to require a non-negative integer value.
  • Reliable destroy behavior: Updated conditional_destroy_sleep and conditional_destroy_crash to always use count = 1, gating the actual behavior inside the destroy-time provisioner command so these resources are always in state.
  • Deterministic destroy ordering: Added depends_on from conditional_destroy_crash to conditional_destroy_sleep to ensure sleep always runs before crash when both are enabled.
  • Module structure compliance: Added all files required by the CONTRIBUTING.md guide:
    • .terraform-docs.yml — standard terraform-docs configuration
    • outputs.tf — outputs extracted from main.tf into a dedicated file
    • docs/header.md — module overview, key features, and basic usage examples
    • docs/footer.md — example links, provider resources, and support section
    • _examples/basic/main.tf — functional example demonstrating all six control variables
    • README.md — replaced with terraform-docs inject markers, ready for generation

@frmadem frmadem requested a review from kastras March 31, 2026 10:35
@frmadem frmadem requested a review from a team as a code owner March 31, 2026 10:35
@frmadem frmadem linked an issue Mar 31, 2026 that may be closed by this pull request
3 tasks
@frmadem frmadem requested a review from Copilot March 31, 2026 10:41
Copy link
Copy Markdown
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

Adds destroy-phase controls to the modules/dummy Terraform module so CI/CD pipelines can simulate slow or failing terraform destroy runs (per #1143).

Changes:

  • Introduces new module inputs sleep_on_destroy and crash_on_destroy.
  • Adds destroy-time null_resource provisioners to sleep and/or intentionally fail during destroy.
  • Updates the module README usage example to show the new destroy-time controls.

Reviewed changes

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

File Description
modules/dummy/variables.tf Adds new input variables for destroy-phase sleep/crash behavior.
modules/dummy/main.tf Implements destroy-time sleep/crash behavior via null_resource + local-exec provisioners.
modules/dummy/README.md Documents usage example including the new destroy-time controls.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread modules/dummy/variables.tf
Comment thread modules/dummy/main.tf Outdated
Comment thread modules/dummy/main.tf
Comment thread modules/dummy/main.tf Outdated
Comment thread modules/dummy/README.md Outdated
frmadem and others added 2 commits March 31, 2026 12:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@frmadem
Copy link
Copy Markdown
Contributor Author

frmadem commented Apr 1, 2026

@copilot i need you to make the necessary changes to this module to be conformant with the CONTRIBUTING.md guide found at the root of this repository. The final readme will be generated by me.

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

@copilot i need you to make the necessary changes to this module to be conformant with the CONTRIBUTING.md guide found at the root of this repository. The final readme will be generated by me.

Done in commit 3f1d442. The module now conforms to the CONTRIBUTING.md guide:

  • Added .terraform-docs.yml with the standard terraform-docs configuration
  • Extracted outputs from main.tf into a dedicated outputs.tf
  • Created docs/header.md (overview, key features, basic usage examples, file structure)
  • Created docs/footer.md (example links, provider resources, support)
  • Created _examples/basic/main.tf with a practical usage example
  • Replaced README.md with terraform-docs inject markers (<!-- BEGIN_TF_DOCS --> / <!-- END_TF_DOCS -->), ready for you to regenerate

Copilot AI changed the title feat(dummy) : add new controls for the destroy phase feat(dummy): add new controls for the destroy phase Apr 1, 2026
Copy link
Copy Markdown
Contributor

@kastras kastras left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

[dummy] add crash and sleep on destroy

4 participants