Google Cloud Stop

Google Cloud Stop

Certified

Stop a Compute Engine instance

Stops a running Compute Engine instance and optionally waits for it to reach the TERMINATED state. The instance's disks and configuration are preserved.

yaml
type: io.kestra.plugin.gcp.compute.Stop

Create a VM instance and then stop it.

yaml
id: compute_engine_create
namespace: company.team

tasks:
  - id: create_instance
    type: io.kestra.plugin.gcp.compute.Create
    serviceAccount: "{{ secret('GCP_SERVICE_ACCOUNT_KEY') }}"
    projectId: "{{ secret('GCP_PROJECT_ID') }}"
    zone: "us-central1-a"
    instanceName: "kestra-job-{{ execution.id }}"
    machineType: "n1-standard-2"
    sourceImage: "projects/debian-cloud/global/images/family/debian-11"
    startupScript: "apt-get update && apt-get install -y python3"
    waitUntilRunning: "true"

  - id: stop_instance
    type: io.kestra.plugin.gcp.compute.Stop
    serviceAccount: "{{ secret('GCP_SERVICE_ACCOUNT_KEY') }}"
    projectId: "{{ secret('GCP_PROJECT_ID') }}"
    zone: "us-central1-a"
    instanceName: "{{ outputs.create_instance.instanceName }}"
Properties

The name of the Compute Engine instance

The zone where the instance is located

e.g. us-central1-a.

The GCP service account to impersonate

Reference (ref) of the pluginDefaults to apply to this task.

The GCP project ID

SubTypestring
Default["https://www.googleapis.com/auth/cloud-platform"]

The GCP scopes to be used

The GCP service account

DefaultPT10M

The maximum duration to wait for the operation to complete

Default: PT10M. Hitting this timeout fails the task but does not cancel the in-flight GCP operation.

Defaulttrue

Whether to wait for the instance to reach the TERMINATED state before completing the task

Default: true.

The instance's external (public) IP address, if any

Typically null once an instance is stopped, since ephemeral external IPs are released on stop.

The unique GCP instance ID

The name of the instance

The instance's internal (private) IP address

The instance status after the operation

e.g. PROVISIONING, STAGING, RUNNING, STOPPING, TERMINATED.