gcp.compute.instance_template.ensure ​
Create or resolve a GCE Instance Template
Creates a GCE Instance Template; if one already exists with the same name, describes it and returns its self_link / provider_resource_id.
Inputs:
- connection_uuid: Cloud connection UUID (required)
- name: Instance template name (required)
- machine_type: e.g. "e2-medium" (required on create)
- source_image: Boot disk source image URL (required on create)
- disk_size_gb: Boot disk size in GB (optional; GCE defaults to 10)
- disk_type: Boot disk type, e.g. "pd-balanced" (optional)
- provisioning_model: "STANDARD" (default) or "SPOT" (optional)
- service_account_email:Primary SA attached (optional)
- service_account_scopes:List of OAuth scopes (optional)
- network: VPC network name (optional)
- subnetwork: Subnetwork name (optional)
- tags: Network tags list (optional)
- labels: Dict (optional)
- metadata: Dict mapped to GCE metadata items (optional)
- startup_script: Startup script string (optional)
- project_id: Explicit project (optional; defaults to connection)
Outputs:
- name
- provider_resource_id
- self_link
- project_id
- existed: bool
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | Base-gcp |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | Yes | — | — |
name | string | Yes | — | — |
machine_type | string | No | — | — |
source_image | string | No | — | — |
disk_size_gb | integer | No | — | — |
disk_type | string | No | — | — |
provisioning_model | string | No | — | — |
service_account_email | string | No | — | — |
service_account_scopes | json | No | — | — |
network | string | No | — | — |
subnetwork | string | No | — | — |
tags | json | No | — | — |
labels | json | No | — | — |
metadata | json | No | — | — |
startup_script | string | No | — | — |
project_id | string | No | — | — |
workflow_run_id | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
existed | boolean | No | — | — |
name | string | No | — | — |
project_id | string | No | — | — |
provider_resource_id | string | No | — | — |
self_link | string | No | — | — |
connection_uuid | uuid | No | — | — |
labels | json | No | — | — |
machine_type | string | No | — | — |
disk_size_gb | integer | No | — | — |
disk_type | string | No | — | — |
provisioning_model | string | No | — | — |
metadata | json | No | — | — |
network | string | No | — | — |
service_account_email | string | No | — | — |
service_account_scopes | json | No | — | — |
source_image | string | No | — | — |
startup_script | string | No | — | — |
subnetwork | string | No | — | — |
tags | json | No | — | — |
workflow_run_id | string | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "gcp.compute.instance_template.ensure",
"initial_data": {
"connection_uuid": "value",
"name": "value"
}
}