forked from brantburnett/terraform-aws-couchbase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient_secgroup.tf
93 lines (77 loc) · 3.04 KB
/
client_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
90
91
92
93
resource "aws_security_group" "client" {
name_prefix = "CouchbaseClient"
description = "Allows Couchbase protocols from clients to nodes in the cluster"
vpc_id = "${data.aws_subnet.first.vpc_id}"
}
resource "aws_security_group_rule" "client_rest" {
count = "${length(var.client_security_group_ids)}"
security_group_id = "${aws_security_group.client.id}"
type = "ingress"
from_port = 8091
to_port = 8096
protocol = "tcp"
source_security_group_id = "${element(var.client_security_group_ids, count.index)}"
}
resource "aws_security_group_rule" "client_restssl" {
count = "${length(var.client_security_group_ids)}"
security_group_id = "${aws_security_group.client.id}"
type = "ingress"
from_port = 18091
to_port = 18096
protocol = "tcp"
source_security_group_id = "${element(var.client_security_group_ids, count.index)}"
}
resource "aws_security_group_rule" "client_memcached" {
count = "${length(var.client_security_group_ids)}"
security_group_id = "${aws_security_group.client.id}"
type = "ingress"
from_port = 11210
to_port = 11211
protocol = "tcp"
source_security_group_id = "${element(var.client_security_group_ids, count.index)}"
}
resource "aws_security_group_rule" "client_memcached_ssl" {
count = "${length(var.client_security_group_ids)}"
security_group_id = "${aws_security_group.client.id}"
type = "ingress"
from_port = 11207
to_port = 11207
protocol = "tcp"
source_security_group_id = "${element(var.client_security_group_ids, count.index)}"
}
resource "aws_security_group_rule" "client_rest_cidr" {
count = "${length(var.client_cidr_blocks) > 0 ? 1 : 0}"
security_group_id = "${aws_security_group.client.id}"
type = "ingress"
from_port = 8091
to_port = 8096
protocol = "tcp"
cidr_blocks = "${var.client_cidr_blocks}"
}
resource "aws_security_group_rule" "client_restssl_cidr" {
count = "${length(var.client_cidr_blocks) > 0 ? 1 : 0}"
security_group_id = "${aws_security_group.client.id}"
type = "ingress"
from_port = 18091
to_port = 18096
protocol = "tcp"
cidr_blocks = "${var.client_cidr_blocks}"
}
resource "aws_security_group_rule" "client_memcached_cidr" {
count = "${length(var.client_cidr_blocks) > 0 ? 1 : 0}"
security_group_id = "${aws_security_group.client.id}"
type = "ingress"
from_port = 11210
to_port = 11211
protocol = "tcp"
cidr_blocks = "${var.client_cidr_blocks}"
}
resource "aws_security_group_rule" "client_memcached_ssl_cidr" {
count = "${length(var.client_cidr_blocks) > 0 ? 1 : 0}"
security_group_id = "${aws_security_group.client.id}"
type = "ingress"
from_port = 11207
to_port = 11207
protocol = "tcp"
cidr_blocks = "${var.client_cidr_blocks}"
}