-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
68 lines (59 loc) · 1.08 KB
/
main.tf
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# DO NOT DELETE THESE LINES!
#
# Your AMI ID is:
#
# ami-eea9f38e
#
# Your subnet ID is:
#
# subnet-7e08481a
#
# Your security group ID is:
#
# sg-834d35e4
#
# Your Identity is:
#
# autodesk-turkey
#
#module "hello" {
# source = "./example-module"
# command = "echo LOL"
#}
variable "access_key" {}
variable "secret_key" {}
variable "region" {
default = "us-west-1"
}
terraform {
backend "atlas" {
name = "lmok/training"
}
}
variable web_count {
default = "3"
}
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "${var.region}"
}
resource "aws_instance" "web" {
count = "${var.web_count}"
ami = "ami-eea9f38e"
instance_type = "t2.micro"
vpc_security_group_ids = ["sg-834d35e4"]
subnet_id = "subnet-7e08481a"
tags {
Identity = "autodesk-turkey"
family = "adsk"
product = "adsk"
}
}
output "public_ip" {
value = ["${aws_instance.web.*.public_ip}"]
}
output "public_dns" {
value = ["${aws_instance.web.*.public_dns}"]
}