forked from nelg/terraform-aws-nat-instance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
96 lines (81 loc) · 2.58 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
variable "enabled" {
description = "Enable or not costly resources"
type = bool
default = true
}
variable "dry_run" {
description = "Use this flag for safely standing up resources without applying any route changes. Useful for transitioning existing environments from NAT Gateway."
type = bool
default = false
}
variable "name" {
description = "Name for all the resources as identifier"
type = string
}
variable "vpc_id" {
description = "ID of the VPC"
type = string
}
variable "public_subnet" {
description = "ID of the public subnet to place the NAT instance"
type = string
}
variable "private_subnets_cidr_blocks" {
description = "List of CIDR blocks of the private subnets. The NAT instance accepts connections from this subnets"
type = list(any)
}
variable "private_route_table_ids" {
description = "List of ID of the route tables for the private subnets. You can set this to assign the each default route to the NAT instance"
type = list(any)
default = []
}
variable "routes" {
description = "List of CIDRs to break each private subnet into. Caution: this must not exceed the ENI capacity of the provisioned EC2 instance types."
type = list(string)
default = ["0.0.0.0/1", "128.0.0.0/1"]
}
variable "image_id" {
description = "AMI of the NAT instance. Default to the latest Amazon Linux 2"
type = string
default = ""
}
variable "instance_types" {
description = "Candidates of spot instance type for the NAT instance. This is used in the mixed instances policy"
type = list(any)
default = ["t3.medium", "t3a.medium"]
}
variable "use_spot_instance" {
description = "Whether to use spot or on-demand EC2 instance"
type = bool
default = true
}
variable "key_name" {
description = "Name of the key pair for the NAT instance. You can set this to assign the key pair to the NAT instance"
type = string
default = ""
}
variable "tags" {
description = "Tags applied to resources created with this module"
type = map(any)
default = {}
}
variable "user_data_write_files" {
description = "Additional write_files section of cloud-init"
type = list(any)
default = []
}
variable "user_data_runcmd" {
description = "Additional runcmd section of cloud-init"
type = list(any)
default = []
}
locals {
// Merge the default tags and user-specified tags.
// User-specified tags take precedence over the default.
common_tags = merge(
{
Name = "nat-instance-${var.name}"
},
var.tags,
)
}