-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Open
Labels
configcustom-conditionsFeedback on variable validation, preconditions. postconditions, checks, and test assertionsFeedback on variable validation, preconditions. postconditions, checks, and test assertionsenhancement
Description
Terraform
v0.12.26
Use-cases
When trying to enforce one variable is required not to be empty, if another variable is provided.
Attempted Solutions
variable "alias_record" {
description = "The record name to associate with the RDS."
type = string
default = ""
}
variable "hosted_zone_name" {
description = "The hosted zone name, where to create the alias record. Requieres if alias_record provided"
type = string
default = ""
validation {
condition = var.alias_record != "" ? var.hosted_zone_name != "" : true
error_message = "ERROR: hosted_zone_name can not be empty if alias_record provided."
}
}
iancward and eraac
Metadata
Metadata
Assignees
Labels
configcustom-conditionsFeedback on variable validation, preconditions. postconditions, checks, and test assertionsFeedback on variable validation, preconditions. postconditions, checks, and test assertionsenhancement