forked from brantburnett/terraform-aws-couchbase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
internode_secgroup.tf
89 lines (72 loc) · 2.55 KB
/
internode_secgroup.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
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
data "aws_subnet" "first" {
id = "${element(var.subnet_ids, 0)}"
}
resource "aws_security_group" "internode" {
name_prefix = "CouchbaseInterNode"
description = "Allows Couchbase protocols between nodes in the cluster"
vpc_id = "${data.aws_subnet.first.vpc_id}"
}
resource "aws_security_group_rule" "egress" {
security_group_id = "${aws_security_group.internode.id}"
type = "egress"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
resource "aws_security_group_rule" "erlang_port_mapper" {
security_group_id = "${aws_security_group.internode.id}"
type = "ingress"
from_port = 4369
to_port = 4369
protocol = "tcp"
source_security_group_id = "${aws_security_group.internode.id}"
}
resource "aws_security_group_rule" "rest" {
security_group_id = "${aws_security_group.internode.id}"
type = "ingress"
from_port = 8091
to_port = 8096
protocol = "tcp"
source_security_group_id = "${aws_security_group.internode.id}"
}
resource "aws_security_group_rule" "indexer" {
security_group_id = "${aws_security_group.internode.id}"
type = "ingress"
from_port = 9100
to_port = 9105
protocol = "tcp"
source_security_group_id = "${aws_security_group.internode.id}"
}
resource "aws_security_group_rule" "cbas" {
security_group_id = "${aws_security_group.internode.id}"
type = "ingress"
from_port = 9110
to_port = 9122
protocol = "tcp"
source_security_group_id = "${aws_security_group.internode.id}"
}
resource "aws_security_group_rule" "projector" {
security_group_id = "${aws_security_group.internode.id}"
type = "ingress"
from_port = 9999
to_port = 9999
protocol = "tcp"
source_security_group_id = "${aws_security_group.internode.id}"
}
resource "aws_security_group_rule" "memcached" {
security_group_id = "${aws_security_group.internode.id}"
type = "ingress"
from_port = 11209
to_port = 11210
protocol = "tcp"
source_security_group_id = "${aws_security_group.internode.id}"
}
resource "aws_security_group_rule" "internal" {
security_group_id = "${aws_security_group.internode.id}"
type = "ingress"
from_port = 21100
to_port = 21299
protocol = "tcp"
source_security_group_id = "${aws_security_group.internode.id}"
}