From ff61683dd1a7a0ed93abfb5c28386c26a93d64e8 Mon Sep 17 00:00:00 2001 From: "Byungjin Park (Claud)" Date: Tue, 12 Apr 2022 03:40:26 +0900 Subject: [PATCH] Add validation for version labels of `secrets-manager-secret` module (#7) --- modules/secrets-manager-secret/variables.tf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/secrets-manager-secret/variables.tf b/modules/secrets-manager-secret/variables.tf index 9bbd69e..57128e4 100644 --- a/modules/secrets-manager-secret/variables.tf +++ b/modules/secrets-manager-secret/variables.tf @@ -44,6 +44,13 @@ variable "versions" { alltrue([ for version in var.versions : length(version.labels) > 0 + ]), + alltrue([ + for version in var.versions : + alltrue([ + for label in version.labels : + !contains(["AWSCURRENT", "AWSPENDING", "AWSPREVIOUS"], label) + ]) ]) ]) error_message = "Not valid parameters for `versions`."