-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstance.tf
More file actions
35 lines (29 loc) · 805 Bytes
/
instance.tf
File metadata and controls
35 lines (29 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//resource "aws_key_pair" "key" {
// key_name = "key"
// public_key = "${file("${var.PATH_TO_PUBLIC_KEY}")}"
//}
resource "aws_instance" "testbox0" {
ami = "${lookup(var.AMIS, var.AWS_REGION)}"
instance_type = "t2.micro"
// key_name = "${aws_key_pair.key.key_name}"
// provisioner "file" {
// source = "script.sh"
// destination = "/tmp/script.sh"
// }
// provisioner "remote-exec" {
// inline = [
// "chmod +x /tmp/script.sh",
// "sudo /tmp/script.sh"
// ]
// }
// connection {
// user = "${var.INSTANCE_USERNAME}"
// private_key = "${file("${var.PATH_TO_PRIVATE_KEY}")}"
// }
provisioner "local-exec" {
command = "echo ${aws_instance.testbox0.private_ip} >> private_ips.txt"
}
}
//output "ip" {
// value = "${aws_instance.testbox0.public_ip}"
//}