Commit Graph

30 Commits

Author SHA1 Message Date
Simon Roberts
16c245f43b Reroll https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/3883 (#3943) 2026-05-07 06:39:00 +00:00
Vijay Kumar Singh
a727a2ea02 feat(cloud-function-v2): add support for auto_update_policy (#3881)
Co-authored-by: Julio Castillo <jccb@google.com>
Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2026-04-25 06:48:40 +02: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
Wiktor Niesiobędzki
17abe3e20b reprovision IAM only on function replacement 2026-03-30 16:18:15 +02:00
Ludovico Magnocavallo
0e9fd6bbc1 feat(cloud-function-v2): add support for max_instance_request_concurrency (#3822)
Fixes #3718
2026-03-30 07:47:26 +00:00
Julio Castillo
8d51ccd491 Add Direct VPC Egress support to modules/cloud-function-v2 (#3567)
Fixes #3561
2025-12-05 18:36:52 +01:00
Wiktor Niesiobędzki
2e42c1b548 service_account_config for Cloud Run v2
Additional changes:
* align vpc-connector interface to Cloud Functions
* split managed and unmanaged resources into separate files, this makes
  easier to introduce further changes
* add support for contexts
* move `vpc_connector` variable to variables.tf for Cloud Functions
* remove `create` from `vpc_connector` in Cloud Functions as it was
  sharing the meaning with `vpc_connector_create`
2025-10-27 08:03:53 +01:00
Wiktor Niesiobędzki
d9029e47a0 VPC Connector alignment to Cloud Run v2 + contexts 2025-10-23 15:50:17 +02:00
Wiktor Niesiobędzki
36f2e65465 Cloud Function v2 - contexts and interface refactor 2025-10-23 15:50:17 +02:00
Ludovico Magnocavallo
d4a9cafda4 add support for binary authorization policy to cloud function v2 module (#3116) 2025-05-28 17:01:42 +02:00
Luca Prete
ffb1452dbd Allow to specify function egress settings without using a VPC connector (#2967) 2025-03-19 10:38:33 +00:00
apichick
587edfd8d5 Added min_instances, max_instances, min_throughput and max_throughtpu… (#2706)
* Added min_instances, max_instances, min_throughput and max_throughtput to connector configuration

* refactor interface, also implement in v1 module

* fix blueprint

---------

Co-authored-by: Ludo <ludomagno@google.com>
2024-11-21 08:05:12 +00:00
Ludovico Magnocavallo
8c0be51c34 manage lifecycle of cloud functions v2 IAM (#2456) 2024-07-30 14:08:05 +02:00
Wiktor Niesiobędzki
1d76bfc3ff Add E2E tests for Cloud Functions and fix perma-diff 2024-07-08 16:14:21 +02:00
Ludovico Magnocavallo
0bb75f3ae1 support build service account in cloud function v2 module (#2371) 2024-06-21 20:19:29 +02:00
Ludovico Magnocavallo
d1f7210fa8 strip bucket name from bundle URI (#2362) 2024-06-14 12:31:01 +00:00
Ludovico Magnocavallo
fa00deb747 Support GCS objects in cloud function modules bundles (#2361)
* cloud function v2

* cloud function v1

* blueprints
2024-06-14 11:44:01 +00:00
Ludovico Magnocavallo
97d77d263b support pre-made bundle archives in cloud function modules (#2358) 2024-06-13 14:58:23 +02:00
luigi-bitonti
a14ed9add2 Cloud function CMEK key support (#2270)
* Added support to kms key

* Updated doc

* Fix variable description.

* Updated README

* Cloud function v2 integration with kms

* Fix variables description

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2024-05-14 12:56:10 +00:00
Julio Castillo
3af7e257d2 Add tflint to pipelines (#2220)
* Fix terraform_deprecated_index

https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_index.md

* Fix terraform_deprecated_interpolation

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.5.0/docs/rules/terraform_deprecated_interpolation.md

* Fix more indexing

* Remove unused variable

* Enable TFLint for modules

* Add tflint config file

* Fix chdir

* Lint modules

* TFLint fixes

* TFLint

* Fixes binauthz README

* Fixes DNS response policy tests. Restores MIG outputs.

* Fixes other DNS response policy tests.

* Update tests for fast 2-e

* Moar fixed tests

---------

Co-authored-by: Simone Ruffilli <sruffilli@google.com>
2024-04-17 10:23:48 +02:00
Deepak Kumar
d62012cebc Specify docker_repository field for google_cloudfunctions2_function (#1987)
* fix: allow configuring `docker_repository` for cloud-function2

When docker repository is not specified by default docker repository
`projects/PROJECT_ID/locations/REGION/repositories/gcf-artifacts` is used.
In such a case, terraform plan always generates a difference for `docker_repository`
field as the module passes null value but the tfstate file has the above specified
default value. This fix allows one to prevent unnecessary infrastructure change when
using the default repository as well as any user created repository.

* doc: updated README for cloud-function-v2

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2024-01-20 09:40:26 +00:00
Julio Castillo
46f437fd5d use provided SA for cloud function v2 trigger (#1968) 2024-01-08 16:39:01 +00:00
luigi-bitonti
be5d9b8fe0 Add bug fix in bucket local variable (#1709)
Fix bucket name reference in Cloud Functions if bucket is created and prefix is used.
2023-09-28 10:17:53 +00:00
Luigi Bitonti
15b7215f61 Add bug fix to allow to use Secret Manager secrets to mount files in Cloud Function 2023-09-25 14:51:00 +02:00
Ludovico Magnocavallo
ff8eef6a6f use cloud run bindings for cf v2 invoker role, refactor iam handling in cf v2 and cloud run (#1609) 2023-08-22 07:23:49 +00:00
Miren Esnaola
51bc31ae21 Fix in IAM bindings of cloud function v2 module 2023-07-31 12:39:08 +02:00
Miren Esnaola
a89e0dac31 Fixes in cloud function v2 module for trigger service account 2023-07-28 17:02:36 +02:00
Miren Esnaola
cf567b0c43 Fix in event_filters of trigger_config 2023-07-25 16:22:09 +02:00
Wiktor Niesiobędzki
cc0b278df3 Move IAM grant to function level for trigger SA 2023-07-12 16:19:34 +02:00
Ludovico Magnocavallo
bd3296bc46 Split Cloud Function module in separate v1 and v2 modules (#1450)
* split v1

* v2

* blueprints

* remove _http
2023-06-19 12:50:36 +02:00