gcloud Module

June 10, 2026 ยท View on GitHub

This module allows you to run a series of gcloud commands as part of a Cluster Toolkit deployment.

Usage

- id: my_gcloud_steps
  source: community/modules/gcloud
  settings:
    commands:
      - gcloud compute networks create my-network --subnet-mode=custom
      - gcloud compute networks subnets create my-subnet --network=my-network --range=10.0.0.0/24 --region=us-central1
      - gcloud compute instances create my-vm --zone=us-central1-a --network=my-network --subnet=my-subnet --machine-type=e2-medium
## Dependency Management

This module uses `local-exec` provisioners to run `gcloud` commands. As such, it does not expose any outputs that other Terraform modules can consume to establish dependencies.

To ensure that resources managed by this module are fully provisioned before other modules in subsequent deployment groups run, you **must** place this `gcloud` module in a deployment group that is ordered *before* any groups that depend on the resources it creates.

For example:

```yaml
deployment_groups:
  - group: gcloud_setup
    modules:
      - id: my_gcloud_commands
        source: community/modules/scripts/gcloud
        settings:
          # ... gcloud commands to create a network and subnet

  - group: vm_deployment
    modules:
      - id: my_vms
        source: ./modules/compute/vm
        settings:
          # This module can assume the network and subnet from the gcloud_setup group exist
          network: my-network
          subnet: my-subnet
          # ... other vm settings

Requirements

NameVersion
terraform>= 1.12.2
null>= 3.0

Providers

NameVersion
null>= 3.0

Modules

No modules.

Resources

NameType
null_resource.gcloud_commandsresource

Inputs

NameDescriptionTypeDefaultRequired
commandsA list of gcloud command pairs for creation and destruction.
list(object({
create = string
delete = string
}))
[]no
module_instance_idThe unique ID of this module instance in the blueprint. This is automatically populated by gcluster.stringn/ayes

Outputs

No outputs.