-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
62 lines (52 loc) · 1.04 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
#
# DO NOT DELETE THESE LINES!
#
# Your subnet ID is:
#
# subnet-99a58be2
#
# Your security group ID is:
#
# sg-8e08dfe6
#
# Your AMI ID is:
#
# ami-74ee001b
#
# Your Identity is:
#
# hashiconf-37693cfc748049e45d87b8c7d8b9aacd
#
# Your AccessKeyID and SecretAccessKey are:
#
# AKIAICQ3HPJA54G3WBJA
# cpm7MTswNI1VxNEPw0Ojt4uwUdOGUf8aAFhB7Fey
#
variable "access_key" {}
variable "secret_key" {}
variable "region" {
default = "eu-central-1"
}
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "${var.region}"
}
resource "aws_instance" "web" {
ami = "ami-74ee001b"
instance_type = "t2.micro"
subnet_id = "subnet-99a58be2"
vpc_security_group_ids = [ "sg-8e08dfe6" ]
count = "1"
tags {
Identity = "hashiconf-37693cfc748049e45d87b8c7d8b9aacd"
Owner = "Rob klein Gunnewiek"
Organization = "Bol.com"
}
}
output "public_ip" {
value = "${join(", ", aws_instance.web.*.public_ip)}"
}
output "public_dns" {
value = "${join(", ", aws_instance.web.*.public_dns)}"
}