-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
53 lines (42 loc) · 952 Bytes
/
Copy pathmain.tf
File metadata and controls
53 lines (42 loc) · 952 Bytes
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
provider "aws" {
region = "us-east-1"
}
resource "aws_instance" "secure_ec2" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "u-24tb1.metal"
associate_public_ip_address = true
key_name = "key-pair"
vpc_security_group_ids = [aws_security_group.web_sg.id]
root_block_device {
volume_size = 20
volume_type = "sc1"
}
ebs_block_device {
device_name = "/dev/sdf"
volume_size = 50
volume_type = "sc1"
}
ebs_block_device {
device_name = "/dev/sdg"
volume_size = 100
volume_type = "sc1"
}
tags = {
Name = "Web production server"
}
}
resource "aws_security_group" "web_sg" {
name_prefix = "web-sg"
ingress {
from_port = 0
to_port = 65535
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 65535
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}