Skip to content

Commit

Permalink
added changes to update validation block.
Browse files Browse the repository at this point in the history
  • Loading branch information
velotioaastha committed Feb 28, 2024
1 parent 3e0a0a9 commit 28ae9b8
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
variable "namespace" {
type = string
description = "String used for prefix resources."
default = ""
default = "test"
}

variable "deletion_protection" {
Expand Down Expand Up @@ -77,7 +77,7 @@ variable "database_innodb_lru_scan_depth" {
}

variable "database_performance_insights_kms_key_arn" {
default = null
default = ""
description = "Specifies an existing KMS key ARN to encrypt the performance insights data if performance_insights_enabled is was enabled out of band"
nullable = true
type = string
Expand Down Expand Up @@ -358,14 +358,11 @@ variable "bucket_name" {
type = string
default = ""
}

variable "bucket_kms_key_arn" {
type = string
description = "The Amazon Resource Name of the KMS key with which S3 storage bucket objects will be encrypted."
default = null
type = string
default = ""
validation {
# regex(...) fails if it cannot find a match
condition = can(regex("^arn:aws:kms:*:*"))
condition = can(regex("^arn:aws:kms:[a-z0-9-]+:[0-9]+:key/[a-zA-Z0-9-_]+$",var.bucket_kms_key_arn)) || var.bucket_kms_key_arn == ""
error_message = "Invalid value for bucket kms ARN"
}
}
Expand Down Expand Up @@ -402,13 +399,11 @@ variable "other_wandb_env" {
##########################################
# New Vars for Encryption #
##########################################

variable "db_kms_key_arn" {
type = string
default = null
default = ""
validation {
# regex(...) fails if it cannot find a match
condition = can(regex("^arn:aws:kms:*:*"))
error_message = "Invalid value for db kms ARN"
condition = can(regex("^arn:aws:kms:[a-z0-9-]+:[0-9]+:[a-zA-Z0-9-_]+:[a-zA-Z0-9-_]+", var.db_kms_key_arn)) || var.db_kms_key_arn == ""
error_message = "Invalid value for bucket kms ARN"
}
}

0 comments on commit 28ae9b8

Please sign in to comment.