From 5ee154bdfd40375d41c43bf14d033487e9584b36 Mon Sep 17 00:00:00 2001 From: tendhar33 <58262390+tendhar33@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:25:29 +0000 Subject: [PATCH] Update variables.tf Added validation for external_id --- modules/aws/vendor-access/variables.tf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/aws/vendor-access/variables.tf b/modules/aws/vendor-access/variables.tf index e47bf8d..096e564 100644 --- a/modules/aws/vendor-access/variables.tf +++ b/modules/aws/vendor-access/variables.tf @@ -55,6 +55,11 @@ variable "external_id" { default = "" description = "A external ID that correspond to your Organization within StreamNative Cloud, used for all STS assume role calls to the IAM roles created by the module. This will be the organization ID in the StreamNative console, e.g. \"o-xhopj\"." type = string + + validation { + condition = var.external_id == "" || can(regex("^o-", var.external_id)) + error_message = "The external_id must either be empty or start with 'o-'. For example: 'o-xhopj'." + } } variable "external_ids" {