Opentofu

Open-source Terraform alternative for infrastructure provisioning with installation and workflow commands.

majiayu000 efe2459 2 files · 2.0 KB Updated 567 repo stars

File contents

OpenTofu — Terraform Alternative

Installer

echo "⚙️ Installing OpenTofu..."
if command -v tofu &> /dev/null
then
    echo "✅ OpenTofu is already installed."
    tofu version
else
    curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
    chmod +x install-opentofu.sh

    echo "ℹ️ Please inspect the downloaded OpenTofu installer script (install-opentofu.sh) if you wish."
    read -p "Proceed with OpenTofu installation? (y/N): " confirm_tofu
    if [[ "$confirm_tofu" =~ ^[Yy]$ ]]; then
        sudo ./install-opentofu.sh --install-method deb
        rm -f install-opentofu.sh
        if [ $? -eq 0 ]; then
            echo "✅ OpenTofu installed successfully."
            tofu version
        else
            echo "❌ Error installing OpenTofu. Please check the output above."
        fi
    else
        echo "⏩ Skipping OpenTofu installation."
        rm -f install-opentofu.sh
    fi
fi

Workflow

tofu init
tofu plan
tofu apply -auto-approve -var key=value
tofu destroy
tofu fmt
tofu validate
tofu version

majiayu000/claude-skill-registry-data/tree/main/data/opentofu commit efe2459b1b

Frequently asked questions

npx skillmds add majiayu000/opentofu