Repository navigation
Expand file tree
/
Copy pathvariables.tf
More file actions
76 lines (62 loc) · 1.49 KB
/
Copy pathvariables.tf
File metadata and controls
76 lines (62 loc) · 1.49 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
variable "ssh_public_key_path" {
description = "Path to your SSH public key"
type = string
default = "/home/codespace/.ssh/id_rsa.pub"
}
variable "ami" {
description = "AMI ID for EC2 instance"
type = string
default = "ami-0c02fb55956c7d316" # Amazon Linux 2
}
variable "key_name" {
description = "Key pair name"
type = string
default = "Terraform-key"
}
variable "instance_type" {
description = "EC2 instance type"
type = string
default = "t2.micro"
}
variable "ssh_cidr" {
description = "Allowed CIDR block for SSH access"
type = string
default = "0.0.0.0/0"
}
variable "sg_name" {
default = "allow_ssh"
}
variable "sg_description" {
default = "Allow SSH inbound traffic"
}
variable "ssh_port" {
description = "Port to allow SSH"
type = number
default = 22
}
variable "instance_count" {
description = "Number of EC2 instances to create"
type = number
default = 3
}
variable "ec2_username" {
description = "Default SSH username for EC2 instance"
type = string
default = "ec2-user" # change to 'ubuntu' if needed
}
variable "root_volume_size" {
description = "Size of the EC2 root volume in GB"
type = number
default = 20
}
variable "root_volume_type" {
description = "Type of the EC2 root volume (gp2, gp3, io1, etc.)"
type = string
default = "gp3"
}
variable "tags" {
description = "Resource tags"
default = {
Name = "EC2"
}
}