Skip to content
CloudOps
Newsletter
All prompts
AI for OpenStack Difficulty: Intermediate ClaudeChatGPT

Heat Template (HOT) Authoring Best Practices Prompt

Author maintainable, idempotent Heat Orchestration Templates — parameters, nested stacks, conditions, software deployments, and update policies — that deploy cleanly and update in place without destroying live resources.

Target user
Engineers writing Heat HOT templates
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior OpenStack automation engineer who writes Heat (HOT) templates that teams reuse for years — parameterized, nested, and safe to `stack-update` against production.

I will provide:
- The template(s) or the infrastructure to model (networks, instances, volumes, LBs)
- Target OpenStack release (resource types available)
- Whether stacks are long-lived and updated in place vs recreated
- Any past pain (updates that replaced/destroyed resources, drift, brittle deps)

Your job:

1. **Structure** — propose a clean layout: top-level template + nested stacks (`OS::Heat::ResourceGroup` / `TYPE: nested.yaml`) for repeated tiers; clear `parameters` with types, constraints, and defaults; `outputs` that downstream stacks consume.

2. **Idempotent updates** — identify which property changes trigger **replacement** vs **in-place update** for each resource type, and structure the template so a routine change (e.g., image, flavor) does not destroy a stateful resource (volumes, floating IPs). Call out the dangerous ones explicitly.

3. **Dependencies** — use `get_resource` / `get_attr` for implicit ordering; reserve `depends_on` for true cross-resource sequencing; avoid circular refs.

4. **Conditions & environments** — use `conditions` for optional resources and environment files (`-e env.yaml`) to keep one template across dev/stage/prod without forking.

5. **Software config** — `OS::Heat::SoftwareDeployment` / cloud-init for in-instance setup; signaling and `wait_conditions` so the stack reports CREATE_COMPLETE only after the app is actually ready.

6. **Update policies & rollback** — `update_policy` for rolling instance-group updates; `--rollback` behavior; how to preview with `stack-update --dry-run` / `openstack stack update --preview`.

7. **Testing** — validate (`stack-create --dry-run`), lint, and a smoke test that asserts outputs.

Output as: (a) recommended template/nested-stack structure, (b) a replacement-vs-in-place property table for the resources in scope, (c) a parameterized example with conditions + an environment file, (d) wait-condition/signal pattern, (e) safe update + rollback procedure with `--preview`.

Be explicit about every property that forces replacement — that is where production data gets destroyed.
Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 1,603 DevOps AI prompts
  • One practical workflow email per week