Skip to content

Commit

Permalink
add extra resource
Browse files Browse the repository at this point in the history
  • Loading branch information
DrInTech22 authored Dec 10, 2024
1 parent c244cc1 commit 532c2b8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions terraform/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,17 @@ resource "aws_instance" "ec2" {
}
}

resource "aws_instance" "ec2-1" {
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
}

provisioner "local-exec" {
command = "echo 'Instance provisioned: ${self.public_ip}'"
}
}

0 comments on commit 532c2b8

Please sign in to comment.