From f8788ff41e6334947ff259fde62d303f63940f28 Mon Sep 17 00:00:00 2001 From: Chris Stotler Date: Wed, 27 Nov 2024 10:59:06 -0500 Subject: [PATCH] Update variable lengths --- .bumpversion.cfg | 2 +- CHANGELOG.md | 8 ++++++++ variables.tf | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index fab32b7..09fd8af 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.0 +current_version = 1.0.1 commit = True message = Bumps version to {new_version} tag = False diff --git a/CHANGELOG.md b/CHANGELOG.md index 6723aaf..7b335fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +### [1.0.1] (https://github.com/plus3it/terraform-aws-tardigrade-account-alternate-contacts/releases/tag/1.0.1) + +**Released**: 2024.11.27 + +**Summary**: + +* Adds variable validation + ### [1.0.0] (https://github.com/plus3it/terraform-aws-tardigrade-account-alternate-contacts/releases/tag/1.0.0) **Released**: 2023.02.09 diff --git a/variables.tf b/variables.tf index 8967b17..915c5bc 100644 --- a/variables.tf +++ b/variables.tf @@ -39,7 +39,7 @@ variable "account_alternate_contacts" { condition = alltrue([ for type in var.account_alternate_contacts : length(type.email_address) >= 1 && - length(type.email_address) <= 50 && + length(type.email_address) <= 254 && can(regex("^[\\s]*[\\w+=.#|!&-]+@[\\w.-]+\\.[\\w]+[\\s]*$", type.email_address)) ]) error_message = "Invalid value for email address (must be between 1 and 50 characters and correct syntax)" @@ -48,7 +48,7 @@ variable "account_alternate_contacts" { condition = alltrue([ for type in var.account_alternate_contacts : length(type.phone_number) >= 1 && - length(type.phone_number) <= 50 && + length(type.phone_number) <= 25 && can(regex("^[\\s0-9()+-]+$", type.phone_number)) ]) error_message = "Invalid value for phone number (must be between 1 and 50 characters and correct syntax)"