AgentSkillsCN

deploy-infra

使用 OpenTofu 部署 GCP 基础设施。适用于处理 infra/ 目录或 .tofu 文件时使用。

SKILL.md
--- frontmatter
name: deploy-infra
description: Deploy GCP infrastructure using OpenTofu. Use when working with infra/ directory or .tofu files.
allowed-tools: Bash(bin/deploy-infra*)

Infrastructure Deployment (OpenTofu)

GCP infrastructure is managed with OpenTofu in infra/. Use bin/deploy-infra to deploy.

Commands

CommandDescription
bin/deploy-infraPlan and apply with confirmation prompt
bin/deploy-infra -yAuto-approve (no confirmation)
bin/deploy-infra -fForce unlock stale state lock before planning
bin/deploy-infra -aUpgrade providers before planning
bin/deploy-infra -p PROJECTUse different GCP project (default: modiase-infra)

Module Structure

code
infra/
├── main.tofu           # Root module
├── variables.tofu      # Input variables
├── outputs.tofu        # Exported values
├── tofu.tfvars         # Variable values (gitcrypted)
└── modules/
    ├── ntfy-pubsub/
    ├── gmail-dispatcher/
    ├── hestia/
    └── ...

Important

  • Do NOT run tofu directly - the wrapper handles init and tooling
  • Do NOT deploy without explicit user request - changes can be destructive
  • State stored in GCS: gs://modiase-infra-tofu-state/infra
  • Force unlock sparingly - only when certain lock is stale

Task

$ARGUMENTS