diff --git a/terraform/modules/networking/main.tf b/terraform/modules/networking/main.tf index 4da00bc7..baaf5b48 100644 --- a/terraform/modules/networking/main.tf +++ b/terraform/modules/networking/main.tf @@ -2,7 +2,7 @@ locals { prefix = "${var.domain}-${var.environment}" // Access the A.B part of the CIDR - ab = regex("^(\d+.\d+).", var.vpc_cidr) + ab = regex("^(\\d+.\\d+).", var.vpc_cidr) } // VPC diff --git a/terraform/modules/networking/variables.tf b/terraform/modules/networking/variables.tf index 985526c9..c73b6b67 100644 --- a/terraform/modules/networking/variables.tf +++ b/terraform/modules/networking/variables.tf @@ -17,7 +17,7 @@ variable "vpc_cidr" { description = "The IPv4 CIDR block of the VPC. Use ranges from http://www.faqs.org/rfcs/rfc1918.html." default = "10.0.0.0/16" validation { - condition = can(regex("^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}\/\d+$")) + condition = can(regex("^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}\\/\\d+$")) error_message = "Must be a valid IPv4 address of the form A.B.C.D/E" } }