forked from monzo/etcd3-terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsg.tf
42 lines (37 loc) · 1001 Bytes
/
sg.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
resource "aws_security_group" "default" {
name = "${var.role}.${var.region}.i.${var.environment}.${var.dns["domain_name"]}"
description = "ASG-${var.role}"
vpc_id = "${aws_vpc.default.id}"
tags {
Name = "${var.role}.${var.region}.i.${var.environment}.${var.dns["domain_name"]}"
role = "${var.role}"
environment = "${var.environment}"
}
# etcd peer + client traffic within the etcd nodes themselves
ingress {
from_port = 2379
to_port = 2380
protocol = "tcp"
self = true
}
# etcd client traffic from ELB
egress {
from_port = 2379
to_port = 2380
protocol = "tcp"
self = true
}
# etcd client traffic from the VPC
ingress {
from_port = 2379
to_port = 2380
protocol = "tcp"
cidr_blocks = ["${aws_vpc.default.cidr_block}"]
}
egress {
from_port = 2379
to_port = 2380
protocol = "tcp"
cidr_blocks = ["${aws_vpc.default.cidr_block}"]
}
}