-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
146 lines (125 loc) · 4.09 KB
/
Copy pathvariables.tf
File metadata and controls
146 lines (125 loc) · 4.09 KB
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
####################################################################################################
# Required Variables
variable "project_name" {
description = "Project name used for naming and the Project tag."
type = string
}
variable "instance_name" {
description = "The name of the instance."
type = string
}
variable "ingress_rules" {
description = "List of ingress rules for the instance security group. Access is via SSM Session Manager by default; only open inbound ports you actually serve (e.g. 80/443)."
type = list(object({
description = string
from_port = number
to_port = number
protocol = string
cidr_blocks = list(string)
}))
}
####################################################################################################
# Tagging
variable "additional_tags" {
description = "Additional tags to apply to all resources created by this module."
type = map(string)
default = {}
}
variable "instance_tags" {
description = "Tags to apply only to the EC2 instance resource."
type = map(string)
default = {}
}
####################################################################################################
# Instance Configuration
variable "instance_type" {
description = "The instance type to use for the instance."
type = string
default = "t4g.small"
}
variable "ami_name" {
description = "The name (or name pattern) of the AMI to use for the instance."
type = string
default = "ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-arm64-server-20250610"
}
variable "ami_owner" {
description = "The owner account ID of the AMI."
type = string
default = "099720109477"
}
variable "volume_size" {
description = "The size of the root volume in GB."
type = number
default = 30
}
variable "user_data_script_path" {
description = "Path to a user data script to run on first boot."
type = string
default = ""
}
variable "disable_api_termination" {
description = "Controls whether API termination is disabled."
type = bool
default = false
}
variable "disable_api_stop" {
description = "Controls whether API stop is disabled."
type = bool
default = false
}
variable "allocate_eip" {
description = "Controls whether an Elastic IP should be allocated."
type = bool
default = true
}
####################################################################################################
# Networking
variable "create_vpc" {
description = "Create a minimal public VPC (single subnet + IGW) for the instance. Set false to place the instance in an existing VPC via vpc_id/subnet_id."
type = bool
default = true
}
variable "vpc_id" {
description = "ID of an existing VPC to use when create_vpc is false."
type = string
default = ""
}
variable "subnet_id" {
description = "ID of an existing subnet to use when create_vpc is false."
type = string
default = ""
}
variable "availability_zone" {
description = "Availability zone for the created subnet. Leave empty for default placement."
type = string
default = ""
}
####################################################################################################
# S3 Access
variable "enable_s3_bucket_policy" {
description = "Attach an S3 access policy (scoped to s3_bucket_name) to the instance role."
type = bool
default = false
}
variable "s3_bucket_name" {
description = "Name of the S3 bucket the instance role may access."
type = string
default = ""
}
####################################################################################################
# Public DNS
variable "enable_public_dns" {
description = "Create a public Route53 A record pointing at the instance's EIP."
type = bool
default = false
}
variable "apex_domain" {
description = "Apex domain whose hosted zone holds the DNS record."
type = string
default = ""
}
variable "dns_name" {
description = "FQDN for the public DNS record."
type = string
default = ""
}