mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
Provisions vault with the policies described in the Nomad Vault integration guide, and drops a configuration file for Nomad vault server configuration with its token. The vault root token is exposed to the E2E runner so that tests can write additional policies to vault.
103 lines
1.8 KiB
HCL
103 lines
1.8 KiB
HCL
data "aws_vpc" "default" {
|
|
default = true
|
|
}
|
|
|
|
data "aws_subnet" "default" {
|
|
availability_zone = var.availability_zone
|
|
vpc_id = data.aws_vpc.default.id
|
|
}
|
|
|
|
resource "aws_security_group" "primary" {
|
|
name = local.random_name
|
|
vpc_id = data.aws_vpc.default.id
|
|
|
|
ingress {
|
|
from_port = 22
|
|
to_port = 22
|
|
protocol = "tcp"
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
}
|
|
|
|
# Nomad
|
|
ingress {
|
|
from_port = 4646
|
|
to_port = 4646
|
|
protocol = "tcp"
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
}
|
|
|
|
# Fabio
|
|
ingress {
|
|
from_port = 9998
|
|
to_port = 9999
|
|
protocol = "tcp"
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
}
|
|
|
|
# Consul
|
|
ingress {
|
|
from_port = 8500
|
|
to_port = 8500
|
|
protocol = "tcp"
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
}
|
|
|
|
# Vault
|
|
ingress {
|
|
from_port = 8200
|
|
to_port = 8200
|
|
protocol = "tcp"
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
}
|
|
|
|
# HDFS NameNode UI
|
|
ingress {
|
|
from_port = 50070
|
|
to_port = 50070
|
|
protocol = "tcp"
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
}
|
|
|
|
# HDFS DataNode UI
|
|
ingress {
|
|
from_port = 50075
|
|
to_port = 50075
|
|
protocol = "tcp"
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
}
|
|
|
|
# Spark history server UI
|
|
ingress {
|
|
from_port = 18080
|
|
to_port = 18080
|
|
protocol = "tcp"
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
}
|
|
|
|
ingress {
|
|
from_port = 0
|
|
to_port = 0
|
|
protocol = "-1"
|
|
self = true
|
|
}
|
|
|
|
egress {
|
|
from_port = 0
|
|
to_port = 0
|
|
protocol = "-1"
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
}
|
|
}
|
|
|
|
resource "aws_security_group" "nfs" {
|
|
name = "${local.random_name}-nfs"
|
|
vpc_id = data.aws_vpc.default.id
|
|
|
|
ingress {
|
|
from_port = 2049
|
|
to_port = 2049
|
|
protocol = "tcp"
|
|
security_groups = [aws_security_group.primary.id]
|
|
}
|
|
}
|