Created
April 27, 2019 08:01
-
-
Save pravargauba/a7370c192da4ef92f039074adad0cd54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_instance" "ec2" { | |
ami = "${data.aws_ami.ami.id}" | |
instance_type = "${var.instance_type}" | |
key_name = "${var.key_pair}" | |
vpc_security_group_ids = ["${aws_security_group.ec2-sg.id}"] | |
subnet_id = "${element(random_shuffle.subnet.result,0)}" | |
user_data = "${data.template_file.user_data.rendered}" | |
iam_instance_profile = "${aws_iam_instance_profile.ec2-profile.id}" | |
user_data = "${data.template_file.user_data.rendered}" | |
associate_public_ip_address = "${var.associate_public_ip_address}" | |
count = "${var.count}" | |
root_block_device { | |
volume_type = "${var.root_vol_type}" | |
volume_size = "${var.root_vol_size}" | |
delete_on_termination = "${var.root_vol_delete_on_termination}" | |
} | |
tags { | |
Name = "${var.Team}-${var.App}-${var.Service}-${var.Environment}" | |
Team = "${var.Team}" | |
Environment = "${var.Environment}" | |
Service = "${var.Service}" | |
App = "${var.App}" | |
Terraform = true | |
Business_Vertical = "${var.Business_Vertical}" | |
Owner = "${var.Owner}" | |
Monitor = "yes" | |
Monitor_APP = "${var.Monitor_APP}" | |
Project = "${var.Team}-${var.App}-${var.Service}-${var.Environment}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment