Commit Graph

336 Commits

Author SHA1 Message Date
Ludovico Magnocavallo
ed234bfb46 Fix unresolved variables in starter-gcd and customizations tests (#3967)
* Fix unresolved variables in starter-gcd dataset (#3961)

* Fix unresolved variables in customizations test (#3961)

* leftover files for the fix
2026-05-14 14:36:23 +00:00
Ludovico Magnocavallo
332b516ae8 Add support for org-level service agents in stage 0 (#3962)
* Add support for org-level service agents in stage 0

* update schema doc

* Fix service agents context key separator
2026-05-14 08:36:34 -04:00
Ludovico Magnocavallo
981e4581ee Add project-factory based data platform dataset to FAST project factory stage (#3957)
* dp rewrite stage 0, projects

* remove plan files

* generalize handling of basepath for projects in project-factory module

* central-0 ---> core-0

* add schemas, validate YAMLs, tags

* aspect types

* data catalog policy tag factory

* add support for data catalog taxonomy to project factory

* complete retrofit of old stage configuration, except networking

* shared vpc networking

* networking

* data platform as pf dataset

* docs

* test

* remove legacy dp stage, fix tests and links

* boilerplate

* tfdoc

* fix unrelated tfdoc

* schemas

* fix errors

* schema

* duplicate schemas

* yamllint

* Fix module naming convention for aspect-types

* Fix factories_config in vpcs.tf for net-vpc-factory compatibility

* Update schema documentation based on schema changes

* Fix false rename conflict in .config.yaml files

* Sync schemas and update documentation

* Fix path expansion for aspect-types and revert projects_input to master

* Restore path expansion for org_policies in projects-iam call

* Fix trailing newlines in schema duplicates to satisfy duplicate-diff

* Fix path expansion for data_catalog_taxonomy in taxonomies.tf

* Update inventory for data-platform test and clean up debug prints

* Add full values to data-platform inventory

* Align Stage 2 VPC Factory integration with Stage 0 and fix tests

TAG=agy

* Fix project factory context resolution and data platform datasets

- Update tag context keys in project factory to use file key without 'projects/' prefix.
- Fix tag reference in product-0.yaml.
- Fix shared_vpc_service_config in shared-0.yaml by moving service account to network_users.
- Set parent for domain-0 folder to data-platform.
- Mock net-dev-0 project ID in tests.
- Update inventories.

TAG=agy
CONV=4b37fa5b-bf59-4604-9e8f-b55353d967a0

* Fix project-level tag keys context resolution in project factory

* Fix commented out tag reference in domain-0 .config.yaml

* Fix merge() calls with empty arguments in project-factory and data-catalog-policy-tag

* Update Data Platform dataset README with prerequisites and customization guide

* Add Table of Contents to Data Platform dataset README

* docs: update Data Platform README with project templates tip

* Document data platform output files and linking sequence in README

* Update data platform README with VPC-SC and delegated IAM details

* Refactor data platform dataset and align stage defaults

* Update test inventory and variables for data platform with new prefix
2026-05-12 16:44:32 +02:00
lopezvit
6c9ed94602 Fix custom_roles not permeating when used in dns zone IAM (#3938)
Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2026-05-06 16:23:42 +02:00
lopezvit
8eca61bb46 Add support for static IPs NAT to 2-networking (#3889)
* feat(2-networking): add support for static IPs NAT

* fix(linting): fix linting

* fix(linting): fix linting

* fix(2-networking): factory-cloudnat don't assume that the context values are present.

* fix(2-networking): factory-cloudnat pass region in a try to forward the problem to the module

---------

Co-authored-by: Simone Ruffilli <sruffilli@google.com>
Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
Co-authored-by: Julio Castillo <jccb@google.com>
2026-05-06 13:21:58 +00:00
Luca Prete
04e64c4ae2 Move org policies lower in the project factory dependency chain to support extended context (#3937)
* module project-factory: include project in conditional_var context for org policies

* module project-factory: include project and folders in conditional_var context for org policies

- Move project org policies (explicit and factory) to projects-iam invocation.
- Move folder org policies (explicit and factory) to folder-X-iam invocations (levels 1-4).
- Inject folder_ids into projects-iam condition_vars and pass resolved folders.
- Update and regenerate test inventories (example.yaml, simple.yaml, hardened.yaml).

TAG=agy
CONV=e0f45850-ab01-4600-a2b6-4de62465c204

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2026-05-06 14:48:08 +02:00
Simon Roberts
26dbaa2d6e Enable terraform_naming_convention in tflint (#3930)
* Draft terraform_naming_convention

* Two fast/stages fixes for terraform_naming_convention

* Disable terraform_naming_convention for resources for now

* module fixes for terraform_naming_convention

* tfdoc

* Remove "moved" from recipe and needs-fixing

* Fix moved for spoke_ra

* fix tests

* Use default (snake_case) for resources

* factory.terraform_data.project-preconditions

* First-pass migration of resources + tests

* Fix tests/modules/organization

* Require snake_case for variables; Add annotations for _testing

* permit _fast_debug variable

* Fix net_vpc_factory and net_vpc_firewall tests

* tfdoc addons and recipe

* Fix more tests

* Fix some net-global -> net_global tests

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2026-05-06 06:06:26 +00:00
Julio Castillo
78bf096052 Restore simple s0 inventory 2026-04-27 09:50:15 +02:00
Julio Castillo
30a76ae699 Fix FAST tests 2026-04-27 09:50:15 +02:00
Brewster Malevich
0a22ef3a6f Bump GH template action versions to avoid GHA Node 20 deprecation (#3906)
* Bump GH template action versions to avoid GHA Node 20 deprecation

Github Actions runners are deprecating Node 20 as Node 20 is EOL in April, 2026. More information: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/

This bumps all the GHAs in the FAST stage 0 templates to use newer versions that do not depend on Node 20. This avoids the EOL and clears the deprecation warning in GHA when users run any GHA workflows generated in stage 0.

I just ran stage 0 with these bumps and it seems to work fine.

* Fix failing fast tests from old GHA version in yaml inventory file

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2026-04-25 04:48:00 +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
Simone Ruffilli
9eb69ffaa3 Add attachment groups factory to 2-networking (#3871)
* feat(fast): add attachment groups factory to 2-networking

Adds support for `google_compute_interconnect_attachment_group` in the `2-networking` stage.

By implementing this at the factory level alongside `vlan-attachments`, users can now declaratively aggregate VLAN attachments across multiple VPCs and natively reference them using the `$attachment_groups:<key>` context identifier in their configuration YAMLs.

Includes:
- Factory implementation in `factory-vlan-attachments.tf`.
- New JSON schemas for `attachment-groups` and updates to `vlan-attachments` to support context linkage.
- Test coverage with new inventory generations.

Fixes #3791
2026-04-22 10:22:50 +00:00
Luca Prete
f2d4e937d1 Fix pre-commit hook (#3882) 2026-04-18 10:07:14 +02:00
Ludovico Magnocavallo
1cd7176a72 remove source md5 hash from inventories 2026-04-14 11:33:06 +00:00
Ludovico Magnocavallo
85b0871085 Add net-vpc-factory and starter-gcd dataset to 0-org-setup, fix context in net-vpc-factory (#3860)
* feat(fast/0-org-setup): integrate net-vpc-factory into stage 0

* initial starter dataset

* starter pack

* fix(fast/0-org-setup): correct factory vpcs paths definition and update test inventory

* feat(fast/0-org-setup): add VPC and subnet outputs and update stage tfvars

* test(fast/0-org-setup): update gcd starter defaults and regenerate inventory

* fix(modules/net-vpc-factory): remove internal defaults logic and pass context correctly

* fix typo in dataset fw rule, add missing boilerplate, set sane defaults for net vpc factory

* terraform fmt

* tfdoc, copyright year

* schema docs

* yamllint
2026-04-13 09:42:03 +02:00
Julio Castillo
1cb643b3c1 Decouple logging sinks in FAST stages 0 and 1 (#3858)
* Decouple logging sinks in FAST stages 0 and 1

* Fix ternary

* Fix tests

* Fix vpcsc tests

* Fix typo

* remove filenames
2026-04-11 00:14:15 +02:00
Ludovico Magnocavallo
e72210f43e Remove leftover datasets for data platform (#3854) 2026-04-10 15:41:55 +00:00
Ludovico Magnocavallo
304dd73642 Update boilerplate and project services in 2-networking (#3852)
* chore(fast): update boilerplate in 2-networking yaml files

* chore(fast): replace stackdriver.googleapis.com with logging and monitoring services

* fix(net-vpc-factory): correct description for secondary subnet example
2026-04-10 15:20:22 +00:00
Ludovico Magnocavallo
118b70d456 Remove the FAST data platform stage (#3851)
* chore: remove data platform stage and references

* fix checks
2026-04-10 10:19:20 +02:00
Julio Castillo
74d9e6020d Remove GKE and GCVE stages (#3850) 2026-04-10 09:51:21 +02:00
Simone Ruffilli
a6b98bac28 Add support for attachment-level BGP sessions and candidate_*_router_ip_address (#3827)
* Support VLAN-attachment-level bgp advertisements
* Support for candidate_cloud_router_ip_address and candidate_customer_router_ip_address
2026-04-01 12:21:18 +00:00
lopezvit
956ada4ddd feat(2-networking): add NS And DS record dynamically from sub-zones records (#3818)
* feat(2-networking): add NS And DS record dynamically from sub-zones records

* tfdoc

* feat(test): 2-networking adding dns_delegations test with and without DSSEC

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
Co-authored-by: Simone Ruffilli <sruffilli@google.com>
2026-03-31 08:54:54 +00:00
Ludovico Magnocavallo
2fe082f7d1 Merge remote-tracking branch 'origin/master' into fast-dev 2026-03-26 16:15:17 +00:00
Vannick Trinquier
38e885a47c Add support of organizational based service agents in VPC-SC stage (#3802) 2026-03-18 16:08:08 +07:00
Vannick Trinquier
b4172ec174 Hardened datasets minor fixes (#3795) 2026-03-18 15:54:14 +07:00
Simone Ruffilli
1caeacec20 Support for net-vlan-attachments in 2-networking (#3789) 2026-03-16 15:03:14 +01:00
Ludovico Magnocavallo
349811d31a fix inventory 2026-03-05 11:36:25 +00:00
Ludovico Magnocavallo
f2fd4ecd37 fix inventory after merge 2026-03-04 13:19:37 +00:00
Ludovico Magnocavallo
a44fe55128 Merge remote-tracking branch 'origin/master' into fast-dev 2026-03-04 10:09:18 +00:00
Ludovico Magnocavallo
f794d764e9 Support additional dns_access attributes in GKE cluster modules (#3781) 2026-03-04 11:06:48 +01:00
Ludovico Magnocavallo
e45e8089ff comment alerting policy to prevent e2e errors (#3777) 2026-03-02 09:32:13 +01:00
Ludovico Magnocavallo
0eb171b21e Add support for URL filtering profiles to FAST NGFW add-on (#3768)
* add support for URL filtering profiles to FAST NGFW add-on

* fix YAML linting, add yamllint to pre-commit
2026-02-26 11:54:44 +01:00
Ludovico Magnocavallo
99e27b988e Merge remote-tracking branch 'origin/master' into fast-dev 2026-02-25 15:15:04 +00:00
Ludovico Magnocavallo
6ec1d8f504 Support hyperdisk-balanced options on gke-nodepool module (#3767) 2026-02-25 15:10:29 +00:00
Ludovico Magnocavallo
b6d6babb02 Merge remote-tracking branch 'origin/master' into fast-dev 2026-02-20 13:20:01 +00:00
norbert-loderer
db8eecc999 Corrected network reference and stage_config inside variables.tf (#3747)
Co-authored-by: Simone Ruffilli <sruffilli@google.com>
Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2026-02-19 10:53:33 +00:00
Ludovico Magnocavallo
440b622536 Merge remote-tracking branch 'origin/master' into fast-dev 2026-02-19 09:21:39 +00:00
Wiktor Niesiobędzki
7e42aba824 Fix 404 on creating alerts
Error: Error creating AlertPolicy: googleapi: Error 404: Cannot find metric(s) that match type = "logging.googleapis.com/user/sa-impersonation". If a metric was created recently, it could take up to 10 minutes to become available. Please try again soon.
2026-02-16 16:21:46 +01:00
Ludovico Magnocavallo
6b6e50cc3a fix inventory 2026-02-12 09:30:53 +00:00
Ludovico Magnocavallo
fb21f6aaf8 Change factories_config type in FAST and project/vpc factory modules, add YAML schema validation (#3728)
* stage 0

* stage 1

* networking

* security

* pf stage

* tfdoc

* align schemas

* inventory

* fix observability

* pf module

* pf module budgets

* align fast stages

* align project subfactories

* tfdoc

* schema validation

* add missing schemas

* Fix observability types

---------

Co-authored-by: Julio Castillo <jccb@google.com>
2026-02-11 15:29:49 +00:00
Ludovico Magnocavallo
936c808ff3 Merge remote-tracking branch 'origin/master' into fast-dev 2026-02-10 15:59:57 +00:00
Julio Castillo
ddab73d03f Add basic observability example to classic dataset (#3697)
* Add basic observability example to classic dataset

* Add boilerplate and observability schema

* Lint fix

* Add observability schema to project-factory module

* Extend duplicate-diff

* Fix tests

* Remove unused schemas
2026-02-10 14:35:13 +00:00
Simone Ruffilli
494ecba511 Refactor subnets mgmt in net-vpc-factory (#3715)
Refactor subnets mgmt in net-vpc-factory

This commit removes the ability to define subnets inline within the VPC `.config.yaml` across `net-vpc-factory` and enforces file-based subnet definitions using the `subnets/` subdirectory pattern.

Key changes include:
- **Module Updates:** Removed standard and non-standard inline subnet arguments (`subnets`, `subnets_private_nat`, `subnets_proxy_only`, `subnets_psc`) from the factory module's internal `vpcs` instantiation.
- **Schema & Docs:** Renamed `vpc.schema.json` to `vpc-factory.schema.json`, stripping inline subnet definitions from the JSON schema, and updated the module `README.md` to reflect the new file-based only approach.
- **Stage 2 Networking Configs:** Refactored datasets to migrate inline `subnets_proxy_only` definitions into standalone files like `subnets/prod-proxy.yaml`. Added a new exported output `subnet_ips` for downstream usage.

<!--
**Breaking Changes**

```upgrade-note
`fast/stages/2-networking`: Proxy-only subnets have been renamed for consistency - unfortunately this results in a nasty create-before-destroy which needs to be handled manually (i.e. delete the existing proxy-only-subnet first, either manually or with a targeted apply, then apply again)
```
-->
2026-02-09 10:51:43 +00:00
Simone Ruffilli
1404fb20da Net-vpc-factory (#3696)
This PR (re :D)introduces module net-vpc-factory, a minimal factory that deals with vpcs, subnets, and firewall rules creation, meant to be embedded into other factories, starting with 2-data-platform and 2-networking.
2026-02-04 11:36:58 +01:00
Julio Castillo
3e277d808a Fix project-factory observability factory (#3695) 2026-02-02 16:02:00 +00:00
Ludovico Magnocavallo
67b44ee39e fix inventory 2026-01-31 07:23:41 +00:00
Ludovico Magnocavallo
30810146cf Merge remote-tracking branch 'origin/master' into fast-dev 2026-01-30 15:54:45 +00:00
Luca Prete
3877a40119 Add PSC-I support to Agent Engine module (#3686) 2026-01-30 07:24:06 +03:00
Ludovico Magnocavallo
d95c4fcc3f Merge remote-tracking branch 'origin/master' into fast-dev 2026-01-27 11:55:58 +00:00
Ludovico Magnocavallo
8490df96bf Use context syntax for VPC-SC access levels and policies (#3678)
* access levels as context

* ingress/egress context in module

* ingress/egress context in module

* update FAST

* tfdoc

* context test
2026-01-26 15:12:26 +00:00