Skip to content

Instantly share code, notes, and snippets.

@rohitg00
Created June 14, 2020 16:49
Show Gist options
  • Save rohitg00/0e9680f69587d5f2b8aa4b7fe1881929 to your computer and use it in GitHub Desktop.
Save rohitg00/0e9680f69587d5f2b8aa4b7fe1881929 to your computer and use it in GitHub Desktop.
//Launching EC2 Instance
resource "aws_instance" "web" {
ami = "${var.ami_id}"
instance_type = "${var.ami_type}"
key_name = "${aws_key_pair.generated_key.key_name}"
security_groups = ["${aws_security_group.web-SG.name}","default"]
//Labelling the Instance
tags = {
Name = "Web-Env"
env = "Production"
}
depends_on = [
aws_security_group.web-SG,
aws_key_pair.generated_key
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment