github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/e2e/terraform/network.tf (about) 1 data "aws_vpc" "default" { 2 default = true 3 } 4 5 data "aws_subnet" "default" { 6 availability_zone = var.availability_zone 7 vpc_id = data.aws_vpc.default.id 8 } 9 10 resource "aws_security_group" "primary" { 11 name = local.random_name 12 vpc_id = data.aws_vpc.default.id 13 14 ingress { 15 from_port = 22 16 to_port = 22 17 protocol = "tcp" 18 cidr_blocks = ["0.0.0.0/0"] 19 } 20 21 # Nomad 22 ingress { 23 from_port = 4646 24 to_port = 4646 25 protocol = "tcp" 26 cidr_blocks = ["0.0.0.0/0"] 27 } 28 29 # Fabio 30 ingress { 31 from_port = 9998 32 to_port = 9999 33 protocol = "tcp" 34 cidr_blocks = ["0.0.0.0/0"] 35 } 36 37 # Consul 38 ingress { 39 from_port = 8500 40 to_port = 8500 41 protocol = "tcp" 42 cidr_blocks = ["0.0.0.0/0"] 43 } 44 45 # HDFS NameNode UI 46 ingress { 47 from_port = 50070 48 to_port = 50070 49 protocol = "tcp" 50 cidr_blocks = ["0.0.0.0/0"] 51 } 52 53 # HDFS DataNode UI 54 ingress { 55 from_port = 50075 56 to_port = 50075 57 protocol = "tcp" 58 cidr_blocks = ["0.0.0.0/0"] 59 } 60 61 # Spark history server UI 62 ingress { 63 from_port = 18080 64 to_port = 18080 65 protocol = "tcp" 66 cidr_blocks = ["0.0.0.0/0"] 67 } 68 69 ingress { 70 from_port = 0 71 to_port = 0 72 protocol = "-1" 73 self = true 74 } 75 76 egress { 77 from_port = 0 78 to_port = 0 79 protocol = "-1" 80 cidr_blocks = ["0.0.0.0/0"] 81 } 82 } 83 84 resource "aws_security_group" "nfs" { 85 name = "${local.random_name}-nfs" 86 vpc_id = data.aws_vpc.default.id 87 88 ingress { 89 from_port = 2049 90 to_port = 2049 91 protocol = "tcp" 92 security_groups = [aws_security_group.primary.id] 93 } 94 }