From bf09785406867a97758bd9fdb6190945259bc0c4 Mon Sep 17 00:00:00 2001 From: Stephen Okpalaononuju Date: Fri, 15 Dec 2023 13:53:19 +0100 Subject: [PATCH 1/2] ch: refactor hack to use regex in terraform --- twilio-iac/terraform-modules/lex/v1/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twilio-iac/terraform-modules/lex/v1/main.tf b/twilio-iac/terraform-modules/lex/v1/main.tf index 558a4da354..9f2157b98c 100644 --- a/twilio-iac/terraform-modules/lex/v1/main.tf +++ b/twilio-iac/terraform-modules/lex/v1/main.tf @@ -23,9 +23,9 @@ resource "aws_lex_slot_type" "this" { # that doesn’t allow numbers or certain special characters. Unfortunately, this restriction is imposed by AWS, # and I cannot directly override it. AWS Lex has specific naming requirements for intents, slots, and bot names # and Terraform enforces these requirements when you create resources. - # So a work-around for the e2e account was to replace the "2" with the letter "" + # So a work-around for the e2e account was to replace the "[0-9]" with the no space "" - name = replace("${local.name_prefix}_${each.key}", "2", "") + name = replace("${local.name_prefix}_${each.key}", "[0-9]", "") description = each.value.description value_selection_strategy = each.value.value_selection_strategy From a496f9fcb3e666f4d408c1260827dc9c740502ac Mon Sep 17 00:00:00 2001 From: Stephen Okpalaononuju Date: Mon, 18 Dec 2023 17:37:35 +0100 Subject: [PATCH 2/2] ch: wrap regex in forward slash --- twilio-iac/terraform-modules/lex/v1/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twilio-iac/terraform-modules/lex/v1/main.tf b/twilio-iac/terraform-modules/lex/v1/main.tf index 9f2157b98c..47ce0ce407 100644 --- a/twilio-iac/terraform-modules/lex/v1/main.tf +++ b/twilio-iac/terraform-modules/lex/v1/main.tf @@ -25,7 +25,7 @@ resource "aws_lex_slot_type" "this" { # and Terraform enforces these requirements when you create resources. # So a work-around for the e2e account was to replace the "[0-9]" with the no space "" - name = replace("${local.name_prefix}_${each.key}", "[0-9]", "") + name = replace("${local.name_prefix}_${each.key}", "/[0-9]/", "") description = each.value.description value_selection_strategy = each.value.value_selection_strategy