cookbook:
  environment:
    public:
    - GCP_REGION=us-central1
    - GCP_ZONE=us-central1-a
    - IMAGE=debian-cloud/debian-12
    - ROOT_DOMAIN=example.invalid
    - ROOT_ZONE=example-invalid
    secrets:
    - GOOGLE_CREDENTIALS
    - WORKLOAD_TOKEN
  pages:
  - page: 1
    name: Debian VM with Docker & 1h Token
    recipes:
    - recipe: launch-vm
      description: Provisions a Debian VM with Docker installed and a 1-hour GCR access
        token.
      form:
      - variable: CUSTOM_IMAGE
        description: Custom Image (optional - leave empty to use default Debian 12)
        type: text
        placeholder: project-id/image-family/image-name
      - variable: DOCKER_IMAGE_TO_PULL
        description: Docker Image to Pull (optional)
        type: text
        placeholder: registry.example.invalid/workload@sha256:<digest>
      - variable: MACHINE_TYPE
        description: Machine Type
        type: select
        options:
        - label: Small (e2-small)
          value: e2-small
        - label: Medium (e2-medium)
          value: e2-medium
        - label: Large (e2-standard-4)
          value: e2-standard-4
        - label: N2 Standard 4 (4 vCPU, 16 GB RAM)
          value: n2-standard-4
        - label: N2 Standard 8 (8 vCPU, 32 GB RAM)
          value: n2-standard-8
        - label: N2 Standard 16 (16 vCPU, 64 GB RAM)
          value: n2-standard-16
        - label: N2 HighMem 4 (4 vCPU, 32 GB RAM)
          value: n2-highmem-4
        - label: N2 HighMem 8 (8 vCPU, 64 GB RAM)
          value: n2-highmem-8
      - variable: BOOT_DISK_SIZE_GB
        description: Boot Disk Size (GB)
        type: select
        options:
        - label: 40 GB
          value: '40'
        - label: 60 GB
          value: '60'
        - label: 80 GB
          value: '80'
      canonical_name: launch-vm
      now:
        steps:
        - step: 1
          name: provision vm
          image: lemc-gcp-terraform-debian-docker-1h:dev
          timeout: 10.minutes
          environment:
          - TERRAFORM_FUNCTION=apply
      in:
        duration: 12.hours
        steps:
        - step: 2
          name: destroy vm after 12 hours
          image: lemc-gcp-terraform-debian-docker-1h:dev
          timeout: 10.minutes
          environment:
          - TERRAFORM_FUNCTION=destroy
    - recipe: create-image
      description: Creates a GCP Disk Image from the running VM.
      form:
      - variable: IMAGE_NAME
        description: New Image Name
        type: text
        placeholder: my-custom-image-name
      canonical_name: create-image
      now:
        steps:
        - step: 1
          name: create image
          image: lemc-gcp-terraform-debian-docker-1h:dev
          environment:
          - TERRAFORM_FUNCTION=image
          timeout: 20.minutes
    - recipe: destroy-vm
      description: Destroys the VM.
      form: []
      canonical_name: destroy-vm
      now:
        steps:
        - step: 1
          name: destroy vm
          image: lemc-gcp-terraform-debian-docker-1h:dev
          timeout: 10.minutes
          environment:
          - TERRAFORM_FUNCTION=destroy
  name: GCP Debian Docker VM With One-Hour Token
  canonical_name: lemc-gcp-terraform-debian-docker-1h
