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