From 11f6fb7120db4a4e081a7a414b75bdb5602b2441 Mon Sep 17 00:00:00 2001 From: Okesanya Odunayo <94924061+DrInTech22@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:23:40 +0100 Subject: [PATCH] update ec2.tf and workflows --- terraform/ec2.tf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/terraform/ec2.tf b/terraform/ec2.tf index 6a1b191..718e7ab 100644 --- a/terraform/ec2.tf +++ b/terraform/ec2.tf @@ -11,4 +11,15 @@ resource "aws_instance" "ec2" { provisioner "local-exec" { command = "echo 'Instance provisioned: ${self.public_ip}'" } +} + +resource "aws_instance" "ec2-2" { + ami = var.ami_id + instance_type = var.instance_type + key_name = var.key_pair_name + subnet_id = aws_subnet.public_subnet.id + vpc_security_group_ids = [aws_security_group.sg.id] + tags = { + Name = var.ec2_name + } } \ No newline at end of file