support secret-level expire time in secret manager module (#2583)

This commit is contained in:
Ludovico Magnocavallo
2024-09-19 17:35:43 +09:00
committed by GitHub
parent c2a9cb7d09
commit cf5bba8b7f
3 changed files with 29 additions and 24 deletions

View File

@@ -33,7 +33,6 @@ locals {
version_keypairs = {
for pair in local.version_pairs : "${pair.secret}:${pair.name}" => pair
}
expire_time = var.expire_time != null ? var.expire_time : ""
}
resource "google_secret_manager_secret" "default" {
@@ -41,7 +40,7 @@ resource "google_secret_manager_secret" "default" {
project = var.project_id
secret_id = each.key
labels = lookup(var.labels, each.key, null)
expire_time = local.expire_time != "" ? local.expire_time : null
expire_time = each.value.expire_time
dynamic "replication" {
for_each = each.value.locations == null ? [""] : []