Skip to content

Commit

Permalink
Fix regex escap sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
devsjc committed Nov 10, 2023
1 parent 811dabf commit 13e7940
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion terraform/modules/networking/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion terraform/modules/networking/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down

0 comments on commit 13e7940

Please sign in to comment.