From f766927c07d4ddaf7484f29f83639a7cebb40b4e Mon Sep 17 00:00:00 2001 From: Michael Li Date: Mon, 9 Oct 2023 11:12:51 -0400 Subject: [PATCH] chore(e2e): Allow ssh to targets to assist with debugging --- enos/modules/aws_target/main.tf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/enos/modules/aws_target/main.tf b/enos/modules/aws_target/main.tf index 9a623f766d..2c11e11384 100644 --- a/enos/modules/aws_target/main.tf +++ b/enos/modules/aws_target/main.tf @@ -1,6 +1,14 @@ # Copyright (c) HashiCorp, Inc. # SPDX-License-Identifier: BUSL-1.1 +terraform { + required_providers { + enos = { + source = "app.terraform.io/hashicorp-qti/enos" + } + } +} + variable "vpc_id" {} variable "ami_id" {} variable "subnet_ids" {} @@ -18,6 +26,8 @@ variable "ingress_cidr" { default = ["10.0.0.0/8"] } +data "enos_environment" "current" {} + resource "aws_security_group" "boundary_target" { name_prefix = "boundary-target-sg" description = "SSH and boundary Traffic" @@ -31,6 +41,14 @@ resource "aws_security_group" "boundary_target" { cidr_blocks = var.ingress_cidr } + ingress { + description = "SSH to the instance" + from_port = 22 + to_port = 22 + protocol = "tcp" + cidr_blocks = flatten([formatlist("%s/32", data.enos_environment.current.public_ipv4_addresses)]) + } + egress { from_port = 0 to_port = 0