Skip to content

Instantly share code, notes, and snippets.

@welsayedaly
Last active November 10, 2021 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save welsayedaly/b3be897bc67ca8095b59fe80e75c89e8 to your computer and use it in GitHub Desktop.
Save welsayedaly/b3be897bc67ca8095b59fe80e75c89e8 to your computer and use it in GitHub Desktop.
resource "aws_instance" "app_server" {
count = 2
ami = "ami-047e03b8591f2d48a"
instance_type = "t2.micro"
key_name = "ec2-deployer-key-pair"
vpc_security_group_ids = [aws_security_group.main.id]
tags = {
Name = "First-Ec2-With-Terraform"
}
connection {
type = "ssh"
host = self.public_ip
user = "ec2-user"
timeout = "4m"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment