-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
68 lines (56 loc) · 1.52 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
variable "environment_type" {
description = "Deployment Environment"
type = string
default = "staging"
validation {
condition = contains(["staging", "production"], var.environment_type)
error_message = "Invalid input, options: \"staging\", \"production\""
}
}
variable "application_type" {
description = "Application Type"
type = string
}
variable "account_number" {
description = "AWS Account Number"
type = string
validation {
condition = can(regex("[1-9]", var.account_number))
error_message = "Account number must be a numerical value"
}
}
variable "region" {
description = "AWS Deployment Region"
type = string
default = "eu-west-1"
validation {
condition = can(regex("[a-z][a-z]-[a-z]+-[1-9]", var.region))
error_message = "Must be valid AWS Region names"
}
}
variable "availability_zones" {
description = "Availability Zones"
type = list(string)
validation {
condition = length(var.availability_zones) > 1
error_message = "Must Contain more than 1 availabilty zone"
}
}
variable "vpc_name" {
description = "VPC Name"
type = string
}
variable "vpc_cidr" {
description = "VPC CIDR Block"
type = string
default = "10.0.0.0/16"
validation {
condition = can(cidrhost(var.vpc_cidr, 0))
error_message = "Must be valid IPv4 CIDR"
}
}
variable "ec2_instance_key" {
description = "EC2 Instance Key"
type = string
default = "frankfurt-test-servers-common"
}