Skip to content

Conversation

@cboneti
Copy link
Member

@cboneti cboneti commented Dec 2, 2025

This PR introduces a new community module community/modules/scripts/gcloud that allows developers to run
arbitrary gcloud commands as part of their Cluster Toolkit deployments.

Motivation:

There are scenarios where direct gcloud execution is necessary within a blueprint:

  1. Rapidly Use New Features: To leverage new GCP features or services that are available in gcloud but not
    yet fully supported in the Terraform provider or integrated into Cluster Toolkit core modules.
  2. Bridge Feature Gaps: To perform specific actions or configurations that are easier or currently only
    possible via the gcloud CLI.

This module provides a flexible way to handle these cases, particularly useful for proofs of concept and
early adoption of features, while more permanent Terraform-based solutions can be developed.

Implementation:

  • The module takes a list of objects, each containing a create and a delete command.
  • It uses local-exec provisioners within a null_resource to run the commands.
  • Create commands are run in the order provided.
  • Delete commands are run in the reverse order during the destroy lifecycle.
  • The module ID is injected via metadata.yaml to ensure proper context.
  • Create/Destroy scripts are generated in the locals block and stored in resource triggers to work within
    Terraform's destroy-time provisioner limitations.

Example:

An example blueprint community/examples/gcloud-example.yaml is included, demonstrating the creation and
deletion of a VPC, subnet, and VM instance using the new module.

Limitations:

  • This module does not produce Terraform outputs. Dependencies on resources created by this module must be
    managed by placing this module in an earlier deployment_group.
  • Idempotency relies on the idempotency of the provided gcloud commands.

This module offers increased flexibility for users needing to integrate gcloud workflows directly into their
Cluster Toolkit deployments.

@cboneti cboneti added the release-key-new-features Added to release notes under the "Key New Features" heading. label Dec 2, 2025
@cboneti cboneti force-pushed the feat/gcloud-module branch 3 times, most recently from abbb2b8 to baf05ae Compare December 2, 2025 21:38
@cboneti cboneti marked this pull request as ready for review December 9, 2025 11:13
@cboneti cboneti requested review from a team and samskillman as code owners December 9, 2025 11:13
This commit introduces a new community module to execute gcloud commands during Cluster Toolkit deployments.

The module allows specifying create and delete commands for resources, providing a way to manage resources not yet available in Terraform or the toolkit. This is particularly useful for rapid prototyping and leveraging new GCP features quickly.

Includes an example blueprint demonstrating network, subnet, and VM creation and deletion.
@cboneti cboneti force-pushed the feat/gcloud-module branch from baf05ae to 5715649 Compare December 9, 2025 11:14
@cboneti
Copy link
Member Author

cboneti commented Dec 9, 2025

/gcbrun

@cboneti cboneti assigned cboneti and bytetwin and unassigned cboneti Dec 16, 2025
@cboneti cboneti merged commit abe6eb3 into GoogleCloudPlatform:develop Jan 5, 2026
11 of 71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-key-new-features Added to release notes under the "Key New Features" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants