/azure-sap-automation:sdaf-state-managementfrom azure-sap-automation
Inspects and repairs SDAF Terraform state using advanced_state_management.sh for safe import/remove operations. Handles state lock ownership and remote state reconciliation with Azure.
Ships in azure-sap-automation. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Action-loop skill. Canonical owner of the warning that
advanced_state_management.sh re-inits on every op. Uses only the reviewed
list / import / remove path documented in the repo and the checked-out
script's own --help; refuses to invent a generic unlock or teardown path.
Trigger on: advanced_state_management.sh, "terraform state list", "state import",
"state rm", "repair remote state", "backend metadata", "resources.lst", "state lock
owner", "remote tfstate disagrees with Azure".
Do NOT trigger on: destroy / teardown / ARM fallback / reverse-order removal,
remover.sh, remove_controlplane.sh, hosted removal wrappers, or a failed run
whose symptom is still ambiguous.
docs/local/07-00-operations.md § Prepare an operational change).SAP_AUTOMATION_REPO_PATH, CONFIG_REPO_PATH, and ARM_SUBSCRIPTION_ID are
set, or the missing-export gate is fixed first.sap_deployer, sap_library, sap_landscape, or
sap_system.import or remove, the exact Terraform address and Azure resource ID
are known. If not, stop and inspect first.deploy/scripts/advanced_state_management.sh.sdaf-safe-removal owns Terraform destroy, reverse-order teardown,
and removal through the documented SDAF operations.sdaf-failure-triage owns an ambiguous failed run before the operator has
established whether the problem is readiness, deploy, removal, or state.If the user is trying to delete resources or finish an incomplete teardown,
route to sdaf-safe-removal. Do not hide removal problems with state edits.
Walk the checklist in references/state-safety.md:
.terraform/terraform.tfstate is backend metadata, not the source of truth..sap_deployment_automation metadata all point at the same backend. The
script can infer backend values when arguments are omitted; inspect before
trusting.list pathBefore changing anything, confirm the checked-out script contract:
"$SAP_AUTOMATION_REPO_PATH/deploy/scripts/advanced_state_management.sh" --help
Then start with the non-destructive intent from the documented list
example in docs/local/07-00-operations.md § Manage state safely:
cd "$CONFIG_REPO_PATH/WORKSPACES/SYSTEM/<SAP_SYSTEM>"
"$SAP_AUTOMATION_REPO_PATH/deploy/scripts/advanced_state_management.sh" \
--parameterfile "<SAP_SYSTEM>.tfvars" \
--type sap_system \
--operation list \
--subscription "<STATE_SUBSCRIPTION_ID>" \
--storage_account_name "<STATE_STORAGE_ACCOUNT>" \
--terraform_keyfile "<SAP_SYSTEM>.terraform.tfstate" \
--workload_zone_name "<WORKLOAD_ZONE>" \
--control_plane_name "<CONTROL_PLANE>"
The script initializes the matching root module, writes resources.lst, and
only then lists resources. Treat any unexpected copy/migrate prompt as a stop
condition; reconcile the backend first and rerun only after review.
import / remove as reviewed repairs, never discoverystate rm stops Terraform from managing a resource; it does not delete
the Azure resource.--azure_resource_id with az resource show --ids
before import. If that lookup fails, stop.import and remove are only valid once resources.lst, the Terraform address,
and the Azure resource ID all match the reviewed target.state rm to bypass a replacement, to make an incomplete removal
look clean, or as a substitute for a destroy plan. Those are boundary
violations: route to sdaf-failure-triage or sdaf-safe-removal.If the docs, script output, Azure resource lookup, and stored metadata do not line up cleanly, say docs are insufficient for a safe reviewed edit and stop.
After any reviewed import/remove:
--operation list to confirm the new association;sdaf-safe-removal
if the next reviewed step is an actual teardown.list as read-only; initialization can still migrate or upgrade
backend/provider state.terraform force-unlock procedure or approve import/remove
without backups and exact identifiers.sdaf-safe-removal, sdaf-failure-triage, sdaf-control-plane-bootstrap,
sdaf-workload-zone, sdaf-sap-system.docs/local/07-00-operations.md, docs/local/troubleshooting.md, and
references/state-safety.md.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sdaf, terraform-state, state-management, terraform-import, terraform-rm
npx claudepluginhub azure/sap-automation --plugin azure-sap-automation18 skills in this plugin
/sdaf-bom-selectionPick the right SDAF BOM for a target SAP product / release / DB platform / version / kernel / topology. Explains where BOMs live in the samples repo (`SAP/` for whole products, `BOM/` for components), decodes the `ms`, `v####`, and `latest` suffix conventions, points at the compatibility guardrails (`supportedPlatforms`, `supportedDBVersions`, `supportedKernels`), and reminds the operator that the download flow needs four explicit BOM keys in `sap-parameters.yaml`. Use when a user says "which BOM do I use", "product BOM vs component BOM", "SAP samples BOM catalog", "BOM_CATALOG", "S4/2023 BOM", "HANA BOM", or "how do I pick a BOM for HANA/Oracle/DB2/ASE". Do NOT use to author a new BOM, to acquire media (`sdaf-media-acquisition`), or to troubleshoot a checksum / 404 (`sdaf-media-diagnostics`).
/sdaf-control-plane-bootstrapDeploy the SDAF control plane locally: prepare DEPLOYER and LIBRARY tfvars, review the plan, run `deploy_controlplane.sh` per `docs/local/03-00-control-plane.md § Run`, and validate the deployer + library + state hand-off. Grounded in `docs/local/03-00-control-plane.md`. Use when a user says "deploy the SDAF control plane", "run deploy_controlplane.sh", "bootstrap SDAF from an empty subscription", "install the deployer" or "create the SAP library". Do NOT use for workload zone (see sdaf-workload-zone), SAP system (see sdaf-sap-system), removal (`sdaf-safe-removal`), or Azure Government / sovereign-cloud deltas (`sdaf-sovereign-cloud`).
Other plugins' skills for the same job