-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker.tf
53 lines (39 loc) · 1.03 KB
/
docker.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
resource "aws_instance" "web2" {
ami = "ami-07c589821f2b353aa"
instance_type = "t2.micro"
key_name = "Jenkins"
vpc_security_group_ids = [aws_security_group.docker_sg.id]
user_data = templatefile("./docker.sh", {})
tags = {
Name = "docker"
}
root_block_device {
volume_size = 30
}
}
resource "aws_security_group" "docker_sg" {
name = "docker_sg"
description = "Allow TLS inbound traffic"
ingress = [
for port in [22, 443, 80, 8080] : {
description = "inbound rules"
from_port = port
to_port = port
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = []
prefix_list_ids = []
security_groups = []
self = false
}
]
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
tags = {
Name = "docker_sg"
}
}