CMEK service agents mapping breaks Composer v2 backward compatibility (#3156)

* allow backward compatibility for unmapped service agents

* docs(modules/project): provide a fallback mechanism in cmek for users to specify additional service agents when needed

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
This commit is contained in:
jnahelou
2025-06-12 20:27:41 +02:00
committed by GitHub
parent 42641397e3
commit d6004f0cd0
2 changed files with 54 additions and 1 deletions

View File

@@ -53,7 +53,7 @@ locals {
for service, keys in var.service_encryption_key_ids : [
# use the deps listed above, if the service does not appear
# there, use all the service agents belonging to the service
for dep in try(local._cmek_agents_by_service[service], [for x in local._service_agents_by_api[service] : x.name]) : {
for dep in try(local._cmek_agents_by_service[service], [for x in local._service_agents_by_api[service] : x.name], [service]) : {
# use index in map key, to allow specifying keys, that will be created in the same apply
for index, key in keys :
"key-${index}.${local._aliased_service_agents[dep].name}" => {