-
Notifications
You must be signed in to change notification settings - Fork 3
/
variables.tf
150 lines (126 loc) · 4.36 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
variable "user_data_script" {
type = "string"
description = "User data script executed at instance boot"
default = ""
}
variable "additional_security_group_ids" {
type = "list"
default = []
description = "Additional security groups to assign to ASG instances on top of the unique one created by this module"
}
variable "asg_health_check_grace_period" {
type = "string"
default = "300"
description = "Time (in seconds) after instance comes into service before checking health"
}
variable "asg_health_check_type" {
type = "string"
default = "EC2"
description = "'EC2' or 'ELB'. Controls how health checking is done"
}
variable "asg_size_max" {
type = "string"
default = "1"
description = "The maximum size of the autoscaling group"
}
variable "asg_size_min" {
type = "string"
default = "1"
description = "The minimum size of the autoscaling group"
}
variable "asg_termination_policies" {
type = "list"
default = ["OldestLaunchConfiguration", "ClosestToNextInstanceHour"]
description = "A list of policies to decide how the instances in the auto scale group should be terminated"
}
variable "asg_load_balancers" {
type = "list"
default = []
description = "A list of load balancer names to add to the autoscaling group names"
}
variable "availability_zones" {
type = "list"
default = []
description = "List of Availability Zones for Subnets and Autoscaling Groups"
}
variable "aws_region" {
type = "string"
description = "The AWS region"
default = "eu-west-1"
}
variable "lc_ami_id" {
type = "string"
description = "The AMI ID to use in the ASG Launch Configuration"
}
variable "lc_instance_type" {
type = "string"
description = "The microservice EC2 instance type"
}
variable "lc_key_name" {
type = "string"
default = ""
description = "The key name that should be used for the instance"
}
variable "load_balancers" {
type = "list"
default = []
description = "A list of load balancers to associate to the ASG"
}
variable "name" {
type = "string"
description = "Microservice name. Used to define resource names and Name tags"
}
variable "nodetype" {
type = "string"
description = "Microservice nodetype. Synonymous with Role. Used to populate Role and Nodetype tag."
}
variable "subnets_cidr" {
type = "list"
default = []
description = "List of CIDR blocks for microservice subnets"
}
variable "subnets_map_public_ip_on_launch" {
type = "string"
default = "0"
description = "Specify true to indicate that instances should be assigned a public IP address"
}
variable "subnets_route_tables" {
type = "list"
description = "List of Route table IDs to associate with the subnets"
default = []
}
# Worth considering going back to indiviual variables here.
# All the modules above are populating these from var.project and var.environment,
# and tier is set per microservice invocation
#
# Doing it this way you cannot mandate that Environment, Application and Tier are set
# but we should never create a microservice that doesn't have all three set.
#
# If we *do* go back to individual variables, we just need to change the references
# to this map to individual variables in the code
variable "tags" {
type = "map"
default = {
Environment = ""
Application = ""
Tier = ""
}
description = "Tags to apply to all components within the microservice"
}
variable "vpc_id" {
type = "string"
description = "Parent VPC ID"
}
variable "asg_enabled_metrics" {
description = "A comma seperated list of metrics to apply to the ASG"
default = "GroupTerminatingInstances,GroupMaxSize,GroupDesiredCapacity,GroupPendingInstances,GroupInServiceInstances,GroupMinSize,GroupTotalInstances"
}
# This is NOT set in the ASG properties in terraform, it is set at create-time using a local-exec provisioner.
# This ensures that desired size can be changed by schedules and other automation without terraform
# wishing to change the desired value undesirably on subsequent runs.
variable "asg_size_desired_on_create" {
type = "string"
description = "The desired size of the ASG *ON CREATION ONLY*"
default = 0
}
# NOTE: Default set to zero so that this code can be used in existing circumstances without a TF error.