Create IPv6 and dual stack enos tests (#5212)
Co-authored-by: Danielle Miu <29378233+DanielleMiu@users.noreply.github.com> Co-authored-by: Damian Debkowski <damian.debkowski@hashicorp.com>
This commit is contained in:
59 files changed
+1773
-301
No files matched your search
@@ -2,52 +2,44 @@
|
||||
# SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
resource "aws_security_group" "enos_vault_sg" {
|
||||
count = var.deploy ? 1 : 0
|
||||
name = "vault-sg-${random_string.cluster_id.result}"
|
||||
description = "SSH and Vault Traffic"
|
||||
vpc_id = var.vpc_id
|
||||
|
||||
# SSH
|
||||
ingress {
|
||||
from_port = 22
|
||||
to_port = 22
|
||||
protocol = "tcp"
|
||||
cidr_blocks = flatten([
|
||||
formatlist("%s/32", data.enos_environment.localhost.public_ipv4_addresses),
|
||||
join(",", data.aws_vpc.infra.cidr_block_associations.*.cidr_block),
|
||||
])
|
||||
from_port = 22
|
||||
to_port = 22
|
||||
protocol = "tcp"
|
||||
cidr_blocks = local.network_stack[var.ip_version].ingress_cidr_blocks
|
||||
ipv6_cidr_blocks = local.network_stack[var.ip_version].ingress_ipv6_cidr_blocks
|
||||
}
|
||||
|
||||
# Vault traffic
|
||||
ingress {
|
||||
from_port = 8200
|
||||
to_port = 8201
|
||||
protocol = "tcp"
|
||||
cidr_blocks = flatten([
|
||||
formatlist("%s/32", data.enos_environment.localhost.public_ipv4_addresses),
|
||||
join(",", data.aws_vpc.infra.cidr_block_associations.*.cidr_block),
|
||||
formatlist("%s/32", var.sg_additional_ips),
|
||||
])
|
||||
from_port = 8200
|
||||
to_port = 8201
|
||||
protocol = "tcp"
|
||||
cidr_blocks = local.network_stack[var.ip_version].ingress_cidr_blocks
|
||||
ipv6_cidr_blocks = local.network_stack[var.ip_version].ingress_ipv6_cidr_blocks
|
||||
}
|
||||
|
||||
# Consul Agent traffic
|
||||
ingress {
|
||||
from_port = 8301
|
||||
to_port = 8301
|
||||
protocol = "tcp"
|
||||
cidr_blocks = flatten([
|
||||
formatlist("%s/32", data.enos_environment.localhost.public_ipv4_addresses),
|
||||
join(",", data.aws_vpc.infra.cidr_block_associations.*.cidr_block),
|
||||
])
|
||||
from_port = 8301
|
||||
to_port = 8301
|
||||
protocol = "tcp"
|
||||
cidr_blocks = local.network_stack[var.ip_version].ingress_cidr_blocks
|
||||
ipv6_cidr_blocks = local.network_stack[var.ip_version].ingress_ipv6_cidr_blocks
|
||||
}
|
||||
|
||||
ingress {
|
||||
from_port = 8301
|
||||
to_port = 8301
|
||||
protocol = "udp"
|
||||
cidr_blocks = flatten([
|
||||
formatlist("%s/32", data.enos_environment.localhost.public_ipv4_addresses),
|
||||
join(",", data.aws_vpc.infra.cidr_block_associations.*.cidr_block),
|
||||
])
|
||||
from_port = 8301
|
||||
to_port = 8301
|
||||
protocol = "udp"
|
||||
cidr_blocks = local.network_stack[var.ip_version].ingress_cidr_blocks
|
||||
ipv6_cidr_blocks = local.network_stack[var.ip_version].ingress_ipv6_cidr_blocks
|
||||
}
|
||||
|
||||
# Internal Traffic
|
||||
@@ -59,10 +51,11 @@ resource "aws_security_group" "enos_vault_sg" {
|
||||
}
|
||||
|
||||
egress {
|
||||
from_port = 0
|
||||
to_port = 0
|
||||
protocol = "-1"
|
||||
cidr_blocks = ["0.0.0.0/0"]
|
||||
from_port = 0
|
||||
to_port = 0
|
||||
protocol = "-1"
|
||||
cidr_blocks = local.network_stack[var.ip_version].egress_cidr_blocks
|
||||
ipv6_cidr_blocks = local.network_stack[var.ip_version].egress_ipv6_cidr_blocks
|
||||
}
|
||||
|
||||
tags = merge(
|
||||
|
||||
Reference in new issue
Block a user