Skip to content

Commit

Permalink
chore(e2e): Allow ssh to targets to assist with debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
moduli committed Oct 10, 2023
1 parent 9c9e033 commit f766927
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions enos/modules/aws_target/main.tf
Original file line number Diff line number Diff line change
@@ -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" {}
Expand All @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit f766927

Please sign in to comment.