ComputeEngine

ComputeEngine

Certified
Enterprise Edition

Run tasks on a Google Compute Engine VM

yaml
type: io.kestra.plugin.ee.gcp.runner.ComputeEngine
yaml
id: compute_engine_shell
namespace: company.team

variables:
  projectId: "my-project"
  zone: "europe-west1-b"

tasks:
  - id: shell
    type: io.kestra.plugin.scripts.shell.Commands
    taskRunner:
      type: io.kestra.plugin.ee.gcp.runner.ComputeEngine
      projectId: "{{ vars.projectId }}"
      zone: "{{ vars.zone }}"
      serviceAccount: "{{ secret('GOOGLE_SA') }}"
      instanceConfig:
        disks:
          - boot: true
            initializeParams:
              sourceImage: "projects/debian-cloud/global/images/family/debian-12"
        networkInterfaces:
          - network: "projects/{{ vars.projectId }}/global/networks/default"
            accessConfigs:
              - type: "ONE_TO_ONE_NAT"
    commands:
      - echo "Hello World"

yaml
id: compute_engine_existing_instance
namespace: company.team

inputs:
  - id: file
    type: FILE

variables:
  projectId: "my-project"
  zone: "europe-west1-b"
  bucket: "my-bucket"

tasks:
  - id: shell
    type: io.kestra.plugin.scripts.shell.Commands
    inputFiles:
      data.txt: "{{ inputs.file }}"
    outputFiles:
      - out.txt
    taskRunner:
      type: io.kestra.plugin.ee.gcp.runner.ComputeEngine
      projectId: "{{ vars.projectId }}"
      zone: "{{ vars.zone }}"
      bucket: "{{ vars.bucket }}"
      instanceName: "my-persistent-vm"
      stopInstance: false
      deleteInstance: false
      serviceAccount: "{{ secret('GOOGLE_SA') }}"
    commands:
      - cp {{ workingDir }}/data.txt {{ workingDir }}/out.txt
Properties
DefaultPT5S
Defaulttrue
Defaulte2-medium
Defaulttrue
SubTypestring
Default["https://www.googleapis.com/auth/cloud-platform"]
Defaulttrue
Defaultfalse
DefaultPT5S
DefaultPT1H