-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvariables.tf
224 lines (183 loc) · 5.96 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
variable "region" {
description = "The region to deploy the instance to"
default = "eu-west-1" # Ireland
}
variable "env" {
description = "The deployment environment this instance belongs to. Possible values: stage, preview, production"
default = "stage"
}
variable "vpc_id" {
description = "The VPC to place the instance in. Ensure it is in the same region you want the instance in"
}
variable "project" {
description = "Project name this instance belongs to"
}
variable "project_id" {
description = "Project billing ID this instance belongs to. This is used to track billing"
}
variable "deployment_type" {
type = string
default = "vm"
description = "The deployment type the resources brought up by this module are part of."
}
variable "owner" {
description = "The project billing owner ID this instance belongs to"
}
variable "end_date" {
description = "The project expected end date"
}
variable "ssh_key_name" {
description = "The name of the preconfigured ssh key pair to add to the instance"
default = "devops"
}
variable "ssh_user" {
description = "SSH user to use to login into the instance"
default = "ubuntu"
}
variable "deployed_app" {
description = "Name of the app to be deployed to this instance"
}
variable "devops_client" {
description = "Devops client name. This is a friendly name used in defining ansible inventories"
}
variable "server_monitoring_playbook" {
description = "The server setup playbook file name. This is the first playbook used to setup basic monitoring and authentication"
default = "server-setup.yml"
}
variable "server_count" {
description = "Number of insntances to deploy"
default = 1
}
variable "server_ami" {
description = "The AMI to use. Note AMIs are specific to a region "
default = "ami-08d658f84a6d84a80"
}
variable "server_instance_type" {
description = "The EC2 instance type to use"
default = "t3.micro"
}
variable "server_volume_size" {
description = "The size of the EBS volume to attach to the instance, in GBs"
default = 8
}
variable "associate_public_ip_address" {
description = "Whether to asssociate a public IP address to this instance"
default = true
}
variable "delete_volume_on_instance_termination" {
description = "Whether to delete the attached volume when the instance is terminated"
default = true
}
variable "vault_password_file" {
description = "Path to the ansible-vault password file"
default = "~/ona/.vault_pass.txt"
}
variable "vpc_security_group_ids" {
description = "Security groups to attach to the instance"
type = list(any)
}
variable "private_ip" {
description = "Private IP address to associate with the instance in a VPC"
type = string
default = null
}
variable "private_ips" {
description = "A list of private IP address to associate with the instance in a VPC. Should match the number of instances."
type = list(any)
default = []
}
variable "public_ip" {
description = "Public IP address to assign to the instance"
type = string
default = null
}
variable "public_ips" {
description = "A list of public IP addresses to assign to the instances. Should match the number of instances."
type = list(any)
default = []
}
variable "assign_elastic_ip" {
description = "Should we use an elastic IP with the instance?"
default = false
}
variable "allow_eip_reassociation" {
description = "Whether to allow an Elastic IP to be re-associated"
type = bool
default = false
}
variable "instance_subnet_id" {
description = "The subnet ID to start the instance in"
default = ""
}
variable "instance_availability_zone" {
description = "The availability zone to start the instance in"
default = ""
}
variable "instance_name_tag" {
description = "The instance name"
default = ""
}
variable "instance_group_tag" {
description = "The instance group tag"
default = ""
}
variable "run_server_setup" {
description = "Should we run the server setup playbook"
default = true
}
variable "run_post_setup_remote_commands" {
type = bool
default = false
description = "Wether to run what is in post_setup_remote_commands"
}
variable "post_setup_remote_commands" {
type = list(string)
default = []
description = "A list of commands to run on the EC2 instance after it becomes available"
}
variable "use_default_aws_security_group" {
type = bool
default = false
description = "Whether to use the default aws security group named 'default'"
}
variable "create_security_group" {
default = false
description = "Whether to create an aws security group"
type = bool
}
variable "security_group_rules" {
default = []
description = "List of AWS security_group_rules to apply"
type = list(object({
type = string
to_port = string
from_port = string
protocol = string
cidr_blocks = list(string)
description = string
}))
}
variable "playbooks_root_dir" {
type = string
default = "../../../../"
description = "The relative path to the directory containing the playbooks to be run"
}
variable "playbooks_inventory_type" {
type = string
default = "public_ip"
}
variable "user_data" {
type = string
description = "The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument."
default = ""
}
variable "ebs_optimized" {
type = bool
default = false
description = "An Amazon EBS–optimized instance uses an optimized configuration stack and provides additional, dedicated capacity for Amazon EBS I/O"
}
variable "iam_instance_profile" {
type = string
default = null
description = "The IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the EC2 documentation, notably iam:PassRole."
}