gcloud-instance-start

command module
v0.0.0-...-8835833 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README


{ "image": "direktiv/gcloud-instance-start", "desc": "Starts a compute engine instance on google cloud." }

GCloud Instance Start

Start a google cloud compute instance using googe apis and a simple golang app to provide authentication via service account key file.

Direktiv

An example workflow that starts an example instance named example-instance-name in the us-central1-a zone.

id: gcloud-start-compute-instance
description: "Start a gcp project instance"
functions:
- id: gcp-start-instance
  image: direktiv/gcloud-instance-start:v1
  size: medium
states:
- id: startInstance
  type: action
  action:
    function: gcp-start-instance
    secrets: ["GCP_SERVICE_ACCOUNT_KEY"]
    input: jq(.)

Input

The input needed to run the above workflow properly is the following:

input:
  project: "GCP_PROJECT"
  serviceAccountKey: "SERVICE_ACCOUNT_KEY"
  instanceID: "example-instance-name"
  zone: "us-central1-a"

When authenticating with the gcloud nothing will be logged to the stdout of the container.

The SERVICE_ACCOUNT_KEY is a string of a Google Cloud service account json key.

To generate a service account key please refer to Google Clouds documentation.

Output

The output will be in JSON format if successful, otherwise an error will be outputed to the logs.

Error

In the case that an error is encountered, it will present in the following format:

{
    "errorCode": "com.gcloud-instance-start.error",
    "errorMsg": "Something went wrong"
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL