-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecurity.tf
More file actions
49 lines (44 loc) · 1.51 KB
/
Copy pathsecurity.tf
File metadata and controls
49 lines (44 loc) · 1.51 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
resource "aws_security_group" "wordpres_security_group" {
name = "wordpres_security_group"
description = "control access to the wordpress server"
}
resource "aws_security_group_rule" "ingress_http" {
security_group_id = "${aws_security_group.wordpres_security_group.id}"
type = "ingress"
cidr_blocks = ["0.0.0.0/0"]
protocol = "tcp"
from_port = 80
to_port = 80
}
resource "aws_security_group_rule" "ingress_https" {
security_group_id = "${aws_security_group.wordpres_security_group.id}"
type = "ingress"
cidr_blocks = ["0.0.0.0/0"]
protocol = "tcp"
from_port = 443
to_port = 443
}
resource "aws_security_group_rule" "ingress_reply" {
security_group_id = "${aws_security_group.wordpres_security_group.id}"
type = "ingress"
cidr_blocks = ["0.0.0.0/0"]
protocol = "tcp"
from_port = 1024
to_port = 65535
}
resource "aws_security_group_rule" "egress_reply" {
security_group_id = "${aws_security_group.wordpres_security_group.id}"
type = "egress"
cidr_blocks = ["0.0.0.0/0"]
protocol = "all"
from_port = 0
to_port = 0
}
resource "aws_security_group_rule" "ingress_ssh" {
security_group_id = "${aws_security_group.wordpres_security_group.id}"
type = "ingress"
cidr_blocks = ["${var.local_ip}/32"]
protocol = "tcp"
from_port = 22
to_port = 22
}