ftl2-destroy-cleans-up-state-file

Status: IN

The destroy script deletes the state file after a successful destroy or when the instance is already gone.

Source: entries/2026/05/11/deployments-catbeez-destroy.md

Example

# From ftl2-servercraft/scripts/neoforge.py
async def destroy(ftl, config, log):
    if not ftl.state.has(config.name):
        log(f"{config.name}: No server in state file, nothing to destroy")
        return
    resource = ftl.state.get(config.name)
    label = resource.get("label", config.name)
    await ftl.local.community.general.linode_v4(label=label, state="absent")
    ftl.state.remove(config.name)

JSON