apply-and-destroy

Apply and destroy OpenTofu + Terragrunt infrastructure with deployment ordering and CI integration.

1|Updated Mar 20, 2025
One-click install
npx skills add https://github.com/asanexample/platform --skill apply-and-destroy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: apply-and-destroy
Source: https://github.com/asanexample/platform/tree/main/.claude/skills/apply-and-destroy
Command: npx skills add https://github.com/asanexample/platform --skill apply-and-destroy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a guide for safely deploying and dismantling OpenTofu + Terragrunt infrastructure, ensuring proper deployment order and avoiding common pitfalls.

Core Features & Use Cases

  • Deployment Ordering: Offers a detailed deployment-ordering DAG for managing infrastructure deployment.
  • Apply and Destroy Commands: Provides the exact commands for applying and destroying infrastructure, with considerations for safety flags.
  • CI Integration: Helps determine if changes have already been applied by CI on merge, avoiding unnecessary manual operations.
  • Platform Management: Assists in managing the platform as a product, not a pile of Terraform configurations.

Quick Start

To apply infrastructure, run the following command: terragrunt run --all apply

Frequently Asked Questions about apply-and-destroy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely apply and destroy OpenTofu and Terragrunt infrastructure?▼

To safely apply and destroy OpenTofu and Terragrunt infrastructure, use the `terragrunt run --all apply` command for deployment, and follow a detailed deployment-ordering DAG to ensure proper sequencing and avoid common pitfalls.

What is the correct deployment order for Terragrunt infrastructure across multiple environments?▼

The correct deployment order is determined using a detailed deployment-ordering DAG, which guides the safe application of infrastructure by structuring dependencies and sequencing operations across complex cloud environments.

Can I use OpenTofu with Terragrunt to manage infrastructure as a product instead of a pile of configurations?▼

Yes, using OpenTofu with Terragrunt helps you manage the platform as a product by providing structured deployment ordering, safe command usage, and clear apply and destroy workflows rather than managing scattered configurations.

How do I avoid manual OpenTofu apply if changes were already deployed by CI on merge?▼

You can avoid manual operations by checking if your CI pipeline already applied the changes on merge, allowing you to skip unnecessary local commands and prevent double-deployment of infrastructure updates.

What safety flags should I consider when running Terragrunt destroy commands?▼

When running Terragrunt destroy commands, you should use specific safety flags and follow the deployment-ordering DAG to dismantle infrastructure safely, ensuring dependencies are removed in the correct reverse sequence.