Skip to content

Commit b4b6370

Browse files
temporary jumpbox
1 parent 19adf72 commit b4b6370

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

infrastructure/nonprod/networking/main.tf

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,35 @@ resource "aws_vpc_security_group_egress_rule" "etl_sg_allow_outbound_requests" {
179179
to_port = 0
180180
cidr_ipv4 = "0.0.0.0/0" # any external IP
181181
}
182+
183+
resource "aws_security_group" "jumpbox" {
184+
description = "Defines traffic flows to and from the jumpbox"
185+
name = "${var.account_name}-jumpbox"
186+
vpc_id = var.vpc_id
187+
}
188+
189+
resource "aws_vpc_security_group_ingress_rule" "cmsvpn_to_jumpbox" {
190+
description = "Allows connections to the jumpbox from cmsvpn"
191+
security_group_id = aws_security_group.jumpbox.id
192+
ip_protocol = "tcp"
193+
from_port = 0
194+
to_port = 0
195+
prefix_list_id = data.aws_ec2_managed_prefix_list.cmsvpn.id
196+
}
197+
198+
resource "aws_key_pair" "jumpbox_key" {
199+
key_name = "jumpbox-key"
200+
public_key = file("~/.ssh/id_ed25519.pub") # Path to your public SSH key
201+
}
202+
203+
resource "aws_instance" "jumpbox" {
204+
ami = "ami-0341d95f75f311023" # Replace with a valid AMI ID for your region (e.g., Amazon Linux 2 AMI)
205+
instance_type = "t2.micro"
206+
key_name = aws_key_pair.jumpbox_key.key_name
207+
subnet_id = "subnet-0f0b5004f3280c894" # npd-east-dev-private-subnet-c
208+
vpc_security_group_ids = [aws_security_group.jumpbox.id]
209+
210+
tags = {
211+
Name = "Jumpbox"
212+
}
213+
}

infrastructure/nonprod/networking/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ output "public_subnet_ids" {
5050

5151
output "vpc_id" {
5252
value = var.vpc_id
53-
}
53+
}

infrastructure/nonprod/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ output "api_db_instance_endpoint" {
1212

1313
output "etl_db_instance_endpoint" {
1414
value = module.etl-db.db_instance_endpoint
15-
}
15+
}

0 commit comments

Comments
 (0)