From 98d63b74e2bbaa53201496e5fbe863d214eba428 Mon Sep 17 00:00:00 2001 From: Federico Maleh Date: Thu, 3 Sep 2026 15:01:07 -0300 Subject: [PATCH] fix(service_definition): honrar dimensions del template y admitir la forma required --- nullplatform/service_definition/README.md | 2 +- nullplatform/service_definition/main.tf | 2 +- nullplatform/service_definition/variables.tf | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nullplatform/service_definition/README.md b/nullplatform/service_definition/README.md index 3a76ad273..59ec4ea90 100644 --- a/nullplatform/service_definition/README.md +++ b/nullplatform/service_definition/README.md @@ -72,7 +72,7 @@ resource "example_resource" "this" { | [available\_actions](#input\_available\_actions) | List of action template names to fetch from the service spec repository | `list(string)` | `[]` | no | | [available\_links](#input\_available\_links) | List of link template names to fetch from the service spec repository | `list(string)` |
[
"connect"
]
| no | | [bitbucket\_email](#input\_bitbucket\_email) | Bitbucket account email, used only when git\_provider = "bitbucket". Set it when repository\_token is an Atlassian API token: those authenticate ONLY via HTTP Basic "email:api\_token" and return 401 with a Bearer header. Leave null when repository\_token is a Bitbucket workspace/repository access token, which is sent as a Bearer token. | `string` | `null` | no | -| [dimensions](#input\_dimensions) | Key-value pairs for dimensions to be associated with the service specification | `map(string)` | `{}` | no | +| [dimensions](#input\_dimensions) | Dimensions for the service specification, used when the spec template does not declare its own. The API accepts both a map of values and the required-flag form, e.g. {"environment": {"required": true}}, so this is intentionally untyped. | `any` | `{}` | no | | [extra\_visibile\_to\_nrns](#input\_extra\_visibile\_to\_nrns) | Additional NRNs that should have visibility to the created service specification | `list(string)` | `[]` | no | | [git\_provider](#input\_git\_provider) | Git provider to fetch service specs from. Supported values: "github", "gitlab", "bitbucket", "local". | `string` | `"github"` | no | | [gitlab\_host](#input\_gitlab\_host) | GitLab host. Only used when git\_provider = "gitlab". Override for self-hosted instances (e.g. "gitlab.mycompany.com"). | `string` | `"gitlab.com"` | no | diff --git a/nullplatform/service_definition/main.tf b/nullplatform/service_definition/main.tf index b0696d777..0a781d4ea 100644 --- a/nullplatform/service_definition/main.tf +++ b/nullplatform/service_definition/main.tf @@ -11,7 +11,7 @@ resource "nullplatform_service_specification" "from_template" { provider = local.service_spec_parsed.selectors.provider sub_category = local.service_spec_parsed.selectors.sub_category } - dimensions = jsonencode(var.dimensions) + dimensions = jsonencode(try(local.service_spec_parsed.dimensions, var.dimensions)) } resource "nullplatform_action_specification" "from_templates" { diff --git a/nullplatform/service_definition/variables.tf b/nullplatform/service_definition/variables.tf index a4cbaf844..2dd0615ff 100644 --- a/nullplatform/service_definition/variables.tf +++ b/nullplatform/service_definition/variables.tf @@ -95,9 +95,9 @@ variable "extra_visibile_to_nrns" { } variable "dimensions" { - type = map(string) + type = any default = {} - description = "Key-value pairs for dimensions to be associated with the service specification" + description = "Dimensions for the service specification, used when the spec template does not declare its own. The API accepts both a map of values and the required-flag form, e.g. {\"environment\": {\"required\": true}}, so this is intentionally untyped." } variable "repository_ref_type" {