-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jordi.bru
committed
May 27, 2024
1 parent
21d8f58
commit d3ade67
Showing
1 changed file
with
16 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,58 @@ | ||
# REQUIRED VARIABLES | ||
|
||
variable "stage" { | ||
description = "Stage of development" | ||
description = "The stage of development (e.g., test, dev, staging, prod)." | ||
type = string | ||
|
||
validation { | ||
condition = can(regex("^(test|dev|stagin|prod)$", var.stage)) | ||
error_message = "Stage must be dev, staging or prod." | ||
condition = can(regex("^(test|dev|staging|prod)$", var.stage)) | ||
error_message = "Stage must be one of the following: test, dev, staging, prod." | ||
} | ||
} | ||
|
||
variable "purpose" { | ||
description = "Short description about the created resource" | ||
description = "A short description about the purpose of the created resource." | ||
type = string | ||
default = null | ||
|
||
validation { | ||
condition = can(regex("^([a-zA-Z0-9-_]*)$", var.purpose)) | ||
error_message = "Only the expression [a-zA-Z0-9-_]* is allowed." | ||
error_message = "Only the characters [a-zA-Z0-9-_] are allowed." | ||
} | ||
} | ||
|
||
variable "owner" { | ||
description = "Owner of the deployed infrastructure" | ||
description = "The owner of the deployed infrastructure." | ||
type = string | ||
default = null | ||
|
||
validation { | ||
condition = length(var.owner) >= 3 | ||
error_message = "You must define an owner with more than three letters." | ||
error_message = "The owner name must be at least three characters long." | ||
} | ||
} | ||
|
||
# CUSTOM VARIABLES | ||
|
||
variable "domain_name" { | ||
description = "Name of the domain" | ||
description = "The name of the domain to attach the certificate." | ||
type = string | ||
default = null | ||
|
||
validation { | ||
condition = length(var.domain_name) >= 3 | ||
error_message = "You must define a domain name that exists on the account." | ||
error_message = "You must define a domain name with at least three characters that exists on the account." | ||
} | ||
} | ||
|
||
variable "validate_cert" { | ||
description = "Validate the certificate" | ||
description = "Indicate whether to validate the certificate." | ||
type = bool | ||
default = true | ||
} | ||
|
||
variable "zone_name" { | ||
description = "route53 zone name" | ||
type = string | ||
default = "jordibru.cloud" | ||
} | ||
description = "The name of the Route 53 hosted zone." | ||
type = string | ||
default = "jordibru.cloud" | ||
} |