Commit Graph

20 Commits

Author SHA1 Message Date
Ludovico Magnocavallo
48fdf03233 artifact-registry: support common_repository in maven, npm, and python remote formats (#3944)
Add `common_repository` support to `maven`, `npm`, and `python` remote repository configurations in the `artifact-registry` module. This replaces the deprecated `custom_repository` feature which is now discouraged by the provider.

Existing README example `registry-mirror` has been updated to use `common_repository`. A legacy test case `legacy_custom_repo` has been added to the bottom of `README.md` to ensure backward compatibility for `custom_repository` continues to work.

TAG=agy
CONV=ffe77e65-ccef-4701-95e6-4ba2d2446f1b
2026-05-07 12:00: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
Ludovico Magnocavallo
a6c284a273 Add context support to artifact-registry, net-lb-app-int, cloudsql modules (#3784)
* artifact-registry

* net-lb-app-int

* copyright

* cloudsql

* fix linting
2026-03-11 12:35:09 +01:00
Suryansh Singhal
ca7e437d60 fix(artifact-registry): resolve permadiff for docker_config immutable_tags (#3652)
A persistent diff was occurring for Docker artifact registries where `immutable_tags` was set to `false`. On every `terraform plan`, Terraform would propose changing `immutable_tags` from `false` to `null`.

This was caused by the `for_each` condition in the `docker_config` dynamic block, which only created the block if `immutable_tags` was explicitly set to `true`.

The condition has been updated to check if `immutable_tags` is not null (`!= null`) instead of checking if it is true (`== true`). This ensures the `docker_config` block is correctly generated for both `true` and `false` values, aligning the configuration with the resource's state and eliminating the persistent diff.

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2026-01-15 10:56:25 +01:00
Julio Castillo
02a9bdfe2b Add tag_bindings to Artifact Registry and Secret Manager modules. (#3220)
* Add `tag_bindings` to Artifact Registry and Secret Manager modules.

* Fix linting

* Fix README
2025-07-07 16:21:54 +00:00
Ludovico Magnocavallo
8cba2ba64d default scanning to null (#3056) 2025-04-29 09:54:18 +02:00
Luca Prete
ea807a36a5 Add vulnerability scanning to artifact registry module (#3040)
* Add vulnerability scanning to artifact registry module

* make variable nullable = false

* tfdoc

---------

Co-authored-by: Luca Prete <lucaprete@google.com>
2025-04-14 18:33:35 +02:00
Tone
cca6f25d37 feat(artifact-registry): Add possibility to setup Docker common remote repository configuration (#2952)
* feat(artifact-registry): Add possibility to setup Docker common remote repository configuration

Add the possibility to setup Docker common remote repository configuration to be able to have remote of internal Artifact Registry repository.

* feat(artifact-registry): Add instructions Readme to setup simple Docker common remote repository configuration
2025-03-13 12:30:35 +00:00
Benoît Sauvère
cb234fd35b feat: implement the new iam interface in artifact-registry (#2606)
Co-authored-by: Julio Castillo <juliocc@users.noreply.github.com>
2024-10-04 13:49:48 +00:00
Julio Castillo
4e8adc9c43 Update modules/artifact-registry with newly-released features. (#2396)
Fixes #2377
2024-06-28 19:52:25 +02:00
Thomas Colomb
3a2484843c artifact-registry: Support cleanup policies (#1891) 2023-12-01 10:33:02 +00:00
Julio Castillo
bd0fe1f928 Fix tests 2023-07-31 18:04:07 +02:00
Julio Castillo
3df98c8feb Fix permadiff in artifact-registry 2023-07-31 18:04:07 +02:00
Ludovico Magnocavallo
5a534edf5c update and refactor artifact registry module (#1536) 2023-07-28 09:54:36 +00:00
Albert Lloveras
c05bc41b69 feat(artifact-registry): Add support for CMEK 2023-06-20 17:27:15 +10:00
Simone Ruffilli
ee25965c89 Copyright bump (#410) 2022-01-01 15:52:31 +01:00
Julio Castillo
1e11c670f5 Update copyright to 2021 2021-02-15 09:38:10 +01:00
Ludovico Magnocavallo
bf23199724 rename iam variables in artifact registry 2020-11-04 16:56:57 +01:00
Julio Castillo
82a1fe3c20 Removing iam_roles from multiple modules
This commits removes the iam_roles variables from the modules:
 - artifact-registry
 - bigtable-instance
 - cloud-function
 - container-registry
 - endopoints
 - pubsub
 - source-repository
2020-10-30 18:58:07 +01:00
Julio Castillo
e1ad77c6d9 Add Artifact Registry module (#81) 2020-05-26 12:03:15 +02:00