Commit Graph

69 Commits

Author SHA1 Message Date
Ludovico Magnocavallo
24775a03ae Fix boot disk validation when attaching existing disk in compute-vm (#4015) 2026-06-07 10:14:48 +00:00
Julio Castillo
2eaa0d5e27 Add support for dynamic tags (#3897)
* Allow creation of dynamic tags

* Extend project factory and related modules to support dynamic values

* Extend folder and organization modules

* project and organization readme

* Simplify dynamic tag support and remove unnecessary restrictions

  • Schemas & Validations: Removed the restriction that forbade combining IAM fields with  allowed_values_regex  on tags. Updated validations in  project  and  organization  modules, and
  simplified all relevant JSON schemas.
  • Module Tag Bindings: Simplified the  tag_value  assignment in  folder ,  project ,  gcs ,  bigquery-dataset , and  kms  modules by removing the defensive  can(regex(...))  check and
  calling  templatestring  directly.
  • Outputs: Removed the  tags_dynamic  output from  project  and  organization  modules, as the same information is now available in  tag_keys .
  • Project Factory: Updated  tag_vars_projects  in  projects.tf  to use the native  namespaced_name  attribute and filtered manually for dynamic tags.

* fix(organization, project): fix linting and tests for dynamic tag support

- Align allowed_values_regex and description extraction in _tags_merged
  locals to use lookup() for consistency with other fields.
- Fix spacing in project context variable (alphabetical ordering).
- Update organization tags test to include the new cost_center tag key
  with allowed_values_regex.
- Update project tags test to include the new cost_center tag key and
  reflect the resolved allowed_values_regex on environment.

* refactor(gcs): refine tag bindings and fix context test

- Add _tag_bindings local to pre-resolve context references, enabling
  templatestring to receive a direct map reference (required by Terraform).
- Use var.context.tag_vars instead of the non-existent local.ctx.tag_vars.
- Fix HCL syntax in context.tfvars (escaped inner quotes).
- Update context test inventory to reflect 3 tag bindings including a
  dynamic value resolved via templatestring.

* refactor: align modules with tag binding context pattern

- Add _tag_bindings local + templatestring dance to cloud-run-v2,
  compute-vm, folder, kms modules (bigquery-dataset already had it)
- Exclude tag_vars from local.ctx in cloud-run-v2, compute-vm, folder,
  kms, project modules (bigquery-dataset already had it)
- Add tag_vars to context variable in cloud-run-v2, compute-vm modules
  (others already had it)
- Update all context tests with dynamic tag binding values using
  var.context.tag_vars

* docs: add module-level tftest.yaml test instructions to GEMINI.md

* docs: regenerate READMEs after tag-regex alignment

- Regenerate variable tables in 7 module READMEs to reflect
  line number shifts from prior tag-regex changes
- Add tag_vars exclusion to gcs ctx local
- Fix whitespace alignment in iam-service-account and
  project-factory tag_vars blocks
- Update tftest resource counts for organization and project
- Remove tags_dynamic from organization/project output tables

* fix(project-factory): update test inventory for tag_bindings module split

- Move tag binding address from folder-2 to folder-2-iam in test
  inventory (tag_bindings moved from creation to IAM modules)
- Update module instance count from 34 to 35
- Regenerate README tables after terraform fmt line shifts
- Apply terraform fmt to variables.tf

* refactor(project-factory): remove unnecessary depends_on from folder-iam modules

Folder IAM modules depend on their own folder creation modules, not
on module.projects. The explicit depends_on was leftover from an
earlier design.

* FAST stages

* Address review comments.

- FAST Stages:
  - Added tag_keys to output-files.tf in 0-org-setup to pass org tags via tfvars.
  - Sorted tag_keys and tag_values in output-files.tf.
  - Updated project-factory, networking, and security stages to use tag_keys.
  - Filtered tag_keys for dynamic tags only.
- Modules:
  - Excluded tag_vars from local.ctx in iam-service-account and organization.
  - Simplified tag_value in iam-service-account.
- Tests:
  - Updated test inventories for 0-org-setup and project-factory.

* Fix tf format

* Fix tfdoc

* docs: add ADR for templatestring vars convention and update status of base path ADR

* More tfdoc

* Update schemas

* Use endswith in context loop

* Address review

* Update FAST readmes

* Update last modules

* Terraform fmt

* Revert alloydb

* Fix whitespace

---------

Co-authored-by: Ludovico Magnocavallo <ludo@qix.it>
2026-04-24 20:45:45 +00:00
Ludovico Magnocavallo
8076220648 Fix regression in compute-vm module (#3872)
* fix(compute-vm): purge key_revocation_action_type from tests and update schema link

* fix schema link
2026-04-15 17:17:42 +00:00
Ludovico Magnocavallo
68f2f29144 fix(compute-vm): add position attribute to attached_disks to control ordering (#3848) 2026-04-09 21:34:15 +02:00
Ludovico Magnocavallo
a4eb4d24fd Compute VM module refactor (#3805)
* add ad for compute-vm refactor

* Exclue nic_type from validated fields, add split of main.tf and template.tf

* boot disk

* fix examples and fixtures

* attached disks

* fix further examples and module-level tests

* remove extra file

* fix mig examples

* finish refactoring variables

* align fast and other modules

* refactor(compute-vm): align examples and ADR with the newly implemented interface

This commit addresses the remaining references of the `instance_type` and `confidential_compute` parameters in the testing environment and updates the ADR.

* feat(compute-vm): add network_performance_config to instance and templates

This change implements the usage of the `network_performance_tier` variable we added earlier into the actual Terraform resources.

---------

Co-authored-by: Wiktor Niesiobędzki <wiktorn@google.com>
2026-03-26 11:31:40 +00:00
Wiktor Niesiobędzki
36b58781ed Use e2-micro instead of f1-micro as default 2026-03-17 14:46:52 +01:00
Suryansh Singhal
761399f055 Allow compute-vm disks to have custom names (#3792)
* module support custom name if provided instead of just {vm_name}-boot

* updated readme.md
2026-03-16 11:22:34 +00:00
Suryansh Singhal
ba304518f1 Prevent recreation for key_revocation_action in compute-vm module (#3620)
* fix(compute-vm): prevent instance recreation for key_revocation_action_type

The `key_revocation_action_type` attribute in the `google_compute_instance`
resource defaults to `NONE` on the provider side.

When this optional attribute was not explicitly set in the module's
`options` variable, it resolved to `null` in the Terraform configuration.
This caused Terraform to detect a change from `null` to `NONE` on every
plan, leading to unnecessary instance recreation.

This change applies `coalesce` to
`var.options.key_revocation_action_type` in the resource definition so
that it defaults to `NONE` when unset, aligning the configuration with
provider behavior and preventing a permadiff.

* updated the regional compute template too with the key_revocation_action_type

* fixed the formatting
2026-01-05 11:53:47 +01:00
Suryansh Singhal
5eeb7b51bb Terraform allow one of X86_64, ARM64 but the validation is for x86_64 has been fixed (#3615)
Co-authored-by: suryansh.singhal <suryansh.singhal@arya.ag>
2026-01-02 12:47:55 +01:00
Ludovico Magnocavallo
525b7be739 module KMS autokey context namespace fixes (#3521) 2025-11-11 08:46:21 +00:00
Ludovico Magnocavallo
7e32058010 [WIP] Add support for KMS autokey (#3515)
* wip

* folder module

* project factory schema

* remove spurious project template

* gcs and compute-vm modules

* variable order
2025-11-09 10:46:28 +01:00
Wiktor Niesiobędzki
b3df16fee8 Add support for ARM based VMs 2025-11-07 08:46:11 +01:00
Wiktor Niesiobędzki
6567d63d92 Add support for hyperdisk performance options 2025-11-07 08:46:11 +01:00
Ludovico Magnocavallo
6045cf6ae2 Add support for contexts to compute-vm module (#3406) 2025-10-13 16:54:13 +02:00
Ludovico Magnocavallo
f7e7b2ccf8 Allow setting resource policies in compute-vm module (#3336)
* allow setting resource policies in compute-vm module

* Update modules/compute-vm/resource-policies.tf

Co-authored-by: Wiktor Niesiobędzki <wiktorn@google.com>

* revert splat change

---------

Co-authored-by: Wiktor Niesiobędzki <wiktorn@google.com>
2025-09-18 07:13:47 +00:00
Ludovico Magnocavallo
c1e8f9d70c add support for startup script to compute-vm module (#3313) 2025-09-09 13:49:38 +02:00
Ludovico Magnocavallo
a3f7faf7d4 Fix boot disk source/params in compute vm module (#3292) 2025-09-01 12:45:42 +00:00
apichick
108258746b Added network tier to network interfaces in compute-vm module (#3151) 2025-06-10 23:26:44 +02:00
Ludovico Magnocavallo
b9ea8a6c26 Allow creation of regional templates in compute-vm module (#3114)
* allow creation of regional templates in compute-vm module

* tfdoc

* fix blueprint
2025-05-27 14:18:40 +02:00
Ludovico Magnocavallo
8af9b4c845 Allow creating disks with no name in compute-vm (#3113)
* allow creating disks with no name

* update template example

* tfdoc
2025-05-27 07:19:13 +00:00
Ludovico Magnocavallo
dde3c1abf2 Add support for non-destructive tag bindings to compute-vm module (#3004)
* wip

* add support for tag bindings

* tfdoc

* improve example

* tfdoc
2025-04-03 18:20:00 +02:00
Taneli Leppä
e4f3f713bb Update list of GPUs. 2025-03-26 13:51:54 +01:00
Taneli Leppä
ccecc32718 compute-vm: Add graceful shutdown configuration and some missing GPUs. 2025-03-26 13:51:54 +01:00
Ludovico Magnocavallo
a002ead06b Add support for advanced machine features to compute-vm (#2855)
* add support for advanced machine features to compute-vm

* fix validation

* Update modules/compute-vm/variables.tf

Co-authored-by: Wiktor Niesiobędzki <wiktorn@google.com>

---------

Co-authored-by: Wiktor Niesiobędzki <wiktorn@google.com>
2025-01-31 09:27:29 +00:00
ooshrioo
ef597a30c0 add GPU options to compute-vm module (#2689)
* add GPU options to comute-vm module

* Fixed tf according ludo's comments

* Added GPU type validation  (by specific values)

* fix validation + README

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2024-11-18 16:40:38 +01:00
Usama Shujaat
6db881da34 Add option to attach multiple snapshot schedule to disks (#2639)
* Add changes to link mutiple Snapshot Schedule to a disk/boot disk

* Update Readme and fix for boot snapshot schedule

* Updating for_each expression, fix linting error

---------

Co-authored-by: usamashujaat <155731944+usamashujaat@users.noreply.github.com>
2024-10-28 18:53:43 +01:00
luigi-bitonti
815abc0afa Added max_run_duration field to compute_vm modules (#2533)
Co-authored-by: Luigi Bitonti <luigi.bitonti@nttdata.com>
2024-08-28 09:36:45 +00:00
Ludovico Magnocavallo
da68d3cfc4 Add support for PSC network attachments and interfaces in modules (#2125)
* support network attachments in net-vpc module

* support network attachments in net-address module

* fix examples

* fix examples

* add support for psc interfaces to compute-vm module
2024-03-04 10:12:11 +01:00
Luca Prete
fa7664434b Enable sole tenancy (node_affinities) on compute_vm (#1903) 2023-12-05 18:05:23 +01:00
Ludovico Magnocavallo
42fa742528 Add support for firewall tags to compute-vm module (#1895)
* add support for firewall tags to compute-vm module

* add support for firewall tags to compute-vm module
2023-12-01 11:27:37 +00:00
Ludovico Magnocavallo
02ccc576f5 fix resource manager tag bindings in compute-vm module (#1771) 2023-10-18 09:24:00 +00:00
luigi-bitonti
0195ea6bca Exposed stack_type variable in compute_vm module (#1756)
* Exposed stack_type variable in compute_vm module

* Updated README.md

* align instance template, fix variable ordering

---------

Co-authored-by: Ludo <ludomagno@google.com>
2023-10-16 06:28:56 +00:00
Ludovico Magnocavallo
df5daab6cc Allow using no service account in compute-vm (#1692)
* module and tests

* align blueprints

* tfdoc

* remove stale variables

* fix blueprint

* variable description
2023-09-19 16:56:51 +00:00
Sam Bentley
b1679ad21a Fix: Instance level stateful disk config (#1578)
* update doco

* fix bug in TF code

* change instance name in README to fix test

* revert disk name

* Update stateful.yaml

* fix examples and tests

---------

Co-authored-by: Julio Castillo <juliocc@gmail.com>
Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2023-08-11 15:25:17 +00:00
Ludovico Magnocavallo
d9f7cef1e7 allow using a separate resource for boot disk (#1496) 2023-07-07 15:40:13 +00:00
Ludovico Magnocavallo
ce647647cc Add support for resource policies to compute vm module (#1467)
* instance schedule

* snapshot resource policy variable and resource

* tfdoc

* snapshot schedules
2023-06-26 06:49:05 +00:00
Julio Castillo
e900e9c951 Make internal/external addresses optional in compute-vm
Fixes 1431
2023-06-08 14:00:10 +02:00
Ludovico Magnocavallo
112d9a8d9c Allow using existing boot disk in compute-vm module (#1241)
* allow using existing boot disk in compute-vm module

* allow setting initialize params to null

* tests

* fast

* blueprints
2023-03-12 10:53:59 +01:00
Taneli Leppä
25e0cba10a Added device_name field to compute-vm attached_disks parameter (for stateful disks). 2023-01-03 16:55:54 +01:00
Sebastian Kunze
5125a5ad03 Replace Docker's gcplogs driver with the GCP COS logging agent (#977) 2022-11-15 13:19:52 +01:00
Giovanni Baratta
ca1dc3659a Add auto_delete and instance_redistribution_type to compute-vm and compute-mig modules. (#890)
* Add auto_delete parameter to compute-vm module

* Add instance_redistribution_type in compute-mig module
2022-10-16 21:19:46 +02:00
Ludovico Magnocavallo
e66340c4db Refactor compute-vm for Terraform 1.3 (#860)
* refactor compute-vm for Terraform 1.3

* bump Terraform version in CI tests config

* fix optional null handling (ht jccb)

* tfdoc

* update blueprints

* align fast

* align README examples
2022-10-07 10:53:53 +02:00
Simone Ruffilli
a29faa7f8c instance_termination_action must be set for compute-vm spot instances (#778)
* Bumped providers version
* Adds ability to control instance_termination_action for SpotVMs
2022-08-20 18:37:17 +02:00
Julio Castillo
e6135bb323 Remove preemptible VMs in favor of spot VMs 2022-05-04 18:01:07 +02:00
Simone Ruffilli
e84f90f9a2 Update variables.tf 2022-05-04 10:01:28 +02:00
Simone Ruffilli
be54fe31d7 Adds Spot VM support to compute-vm 2022-05-04 09:48:31 +02:00
Ludovico Magnocavallo
0b5ed8b7ef Add support for resource management tags and tag bindings (#552)
* organization module

* folder module

* project module

* fix project binding

* use id instead of name for references

* kms module

* compute-vm

* fix compute-vm
2022-02-20 11:14:18 +01:00
Simone Ruffilli
abb6b50a46 Add periods at the end of each description field where missing (#478) 2022-01-31 10:45:34 +01:00
Simone Ruffilli
ee25965c89 Copyright bump (#410) 2022-01-01 15:52:31 +01:00
Andras Gyomrey
d2ef4c3277 Allow using gVNIC in compute-vm (#211) 2021-11-08 11:18:15 +00:00