Overview

Date: 2026-05-11

Time: 15:50

I'll create a summary entry for this GCP teardown example.

Overview

This is a GCP resource teardown script that demonstrates how to use FTL2 to delete cloud infrastructure in the correct dependency order. It serves as the complement to examplegcpprovision.py, showing the full lifecycle pattern of provisioning and deprovisioning GCP resources using FTL2's google.cloud.* modules.

Usage Patterns

The script uses the standard FTL2 async automation pattern:


async with automation(secret_bindings=bindings, verbose=True) as ftl:
    await ftl.google.cloud.gcp_compute_instance(
        name="ftl2-web01",
        zone="us-central1-a",
        state="absent",
    )

Resources are deleted by calling the same modules used for provisioning but with state="absent". Deletion order is the reverse of creation order to respect dependencies: instance → firewalls → subnet → network.

API and Configuration

Environment variables (bound via secret_bindings):

Secret bindings pattern: "google.cloud.*" wildcard binds all three env vars to every module in the google.cloud namespace, so individual module calls don't need to repeat auth parameters.

Automation options: verbose=True enables detailed output during execution.

Key Behaviors

Relationships