GCloudCLI​G​Cloud​C​L​I

yaml
type: "io.kestra.plugin.gcp.cli.GCloudCLI"

Execute gcloud commands.

Examples

Create a cluster then list them using a service account.

yaml
id: gcp_g_cloud_cli
namespace: company.team

tasks:
  - id: g_cloud_cli
    type: io.kestra.plugin.gcp.cli.GCloudCLI
    projectId: my-gcp-project
    serviceAccount: "{{ secret('gcp-sa') }}"
    commands:
      - gcloud container clusters create simple-cluster --region=europe-west3
      - gcloud container clusters list

Create a GCS bucket.

yaml
id: gcp_g_cloud_cli
namespace: company.team

tasks:
  - id: g_cloud_cli
    type: io.kestra.plugin.gcp.cli.GCloudCLI
    projectId: my-gcp-project
    serviceAccount: "{{ secret('gcp-sa') }}"
    commands:
      - gcloud storage buckets create gs://my-bucket

Output the result of a command.

yaml
id: gcp_g_cloud_cli
namespace: company.team

tasks:
  - id: g_cloud_cli
    type: io.kestra.plugin.gcp.cli.GCloudCLI
    projectId: my-gcp-project
    serviceAccount: "{{ secret('gcp-sa') }}"
    commands:
      # Outputs as a flow output for UI display
      - gcloud pubsub topics list --format=json | tr -d '
 ' | xargs -0 -I {} echo '::{"outputs":{"gcloud":{}}}::'

      # Outputs as a file, preferred way for large payloads
      - gcloud storage ls --json > storage.json

Properties

commands

  • Type: array
  • SubType: string
  • Dynamic: ✔️
  • Required: ✔️
  • Min items: 1

The commands to run.

containerImage

  • Type: string
  • Dynamic: ✔️
  • Required:
  • Default: google/cloud-sdk

The task runner container image, only used if the task runner is container-based.

docker

Deprecated, use 'taskRunner' instead

env

  • Type: object
  • SubType: string
  • Dynamic: ✔️
  • Required:

Additional environment variables for the current process.

inputFiles

  • Type:
    • object
    • string
  • Dynamic: ✔️
  • Required:

The files to create on the local filesystem. It can be a map or a JSON object.

namespaceFiles

Inject namespace files.

Inject namespace files to this task. When enabled, it will, by default, load all namespace files into the working directory. However, you can use the include or exclude properties to limit which namespace files will be injected.

outputFiles

  • Type: array
  • SubType: string
  • Dynamic: ✔️
  • Required:

The files from the local filesystem to send to Kestra's internal storage.

Must be a list of glob) expressions relative to the current working directory, some examples: my-dir/, my-dir/*/ or my-dir/my-file.txt.

projectId

  • Type: string
  • Dynamic: ✔️
  • Required:

The GCP project ID to scope the commands to.

serviceAccount

  • Type: string
  • Dynamic: ✔️
  • Required:

The full service account JSON key to use to authenticate to gcloud.

taskRunner

  • Type: TaskRunner
  • Dynamic:
  • Required:
  • Default: { "type": "io.kestra.plugin.scripts.runner.docker.Docker" }

The task runner to use.

Task runners are provided by plugins, each have their own properties.

Outputs

exitCode

  • Type: integer
  • Required: ✔️
  • Default: 0

outputFiles

  • Type: object
  • SubType: string
  • Required:

vars

  • Type: object
  • Required:

Definitions

io.kestra.core.models.tasks.NamespaceFiles

  • enabled
    • Type: boolean
    • Dynamic:
    • Required:
    • Default: true
  • exclude
    • Type: array
    • SubType: string
    • Dynamic:
    • Required:
  • include
    • Type: array
    • SubType: string
    • Dynamic:
    • Required:

io.kestra.plugin.scripts.runner.docker.Cpu

  • cpus
    • Type: integer
    • Dynamic:
    • Required:

io.kestra.core.models.tasks.runners.TaskRunner

  • type
    • Type: string
    • Dynamic:
    • Required: ✔️
    • Validation RegExp: \p{javaJavaIdentifierStart}\p{javaJavaIdentifierPart}*(\.\p{javaJavaIdentifierStart}\p{javaJavaIdentifierPart}*)*
    • Min length: 1

io.kestra.plugin.scripts.runner.docker.Memory

  • kernelMemory
    • Type: string
    • Dynamic: ✔️
    • Required:
  • memory
    • Type: string
    • Dynamic: ✔️
    • Required:
  • memoryReservation
    • Type: string
    • Dynamic: ✔️
    • Required:
  • memorySwap
    • Type: string
    • Dynamic: ✔️
    • Required:
  • memorySwappiness
    • Type: string
    • Dynamic: ✔️
    • Required:
  • oomKillDisable
    • Type: boolean
    • Dynamic:
    • Required:

io.kestra.plugin.scripts.exec.scripts.models.DockerOptions

  • image
    • Type: string
    • Dynamic: ✔️
    • Required: ✔️
    • Min length: 1
  • config
    • Type:
      • string
      • object
    • Dynamic: ✔️
    • Required:
  • cpu
    • Type: Cpu
    • Dynamic:
    • Required:
  • credentials
  • deviceRequests
  • entryPoint
    • Type: array
    • SubType: string
    • Dynamic: ✔️
    • Required:
  • extraHosts
    • Type: array
    • SubType: string
    • Dynamic: ✔️
    • Required:
  • host
    • Type: string
    • Dynamic: ✔️
    • Required:
  • memory
    • Type: Memory
    • Dynamic:
    • Required:
  • networkMode
    • Type: string
    • Dynamic: ✔️
    • Required:
  • pullPolicy
    • Type: string
    • Dynamic:
    • Required:
    • Default: ALWAYS
    • Possible Values:
      • IF_NOT_PRESENT
      • ALWAYS
      • NEVER
  • shmSize
    • Type: string
    • Dynamic: ✔️
    • Required:
  • user
    • Type: string
    • Dynamic: ✔️
    • Required:
  • volumes
    • Type: array
    • SubType: string
    • Dynamic: ✔️
    • Required:

io.kestra.plugin.scripts.runner.docker.Credentials

  • auth
    • Type: string
    • Dynamic: ✔️
    • Required:
  • identityToken
    • Type: string
    • Dynamic: ✔️
    • Required:
  • password
    • Type: string
    • Dynamic: ✔️
    • Required:
  • registry
    • Type: string
    • Dynamic: ✔️
    • Required:
  • registryToken
    • Type: string
    • Dynamic: ✔️
    • Required:
  • username
    • Type: string
    • Dynamic: ✔️
    • Required:

io.kestra.plugin.scripts.runner.docker.DeviceRequest

  • capabilities
    • Type: array
    • SubType: array
    • Dynamic:
    • Required:
  • count
    • Type: integer
    • Dynamic:
    • Required:
  • deviceIds
    • Type: array
    • SubType: string
    • Dynamic: ✔️
    • Required:
  • driver
    • Type: string
    • Dynamic: ✔️
    • Required:
  • options
    • Type: object
    • SubType: string
    • Dynamic:
    • Required: