-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
51 lines (47 loc) · 994 Bytes
/
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
#
# DO NOT DELETE THESE LINES!
#
# Your subnet ID is:
#
# subnet-51ab1e09
#
# Your security group ID is:
#
# sg-01272d66
#
# Your AMI ID is:
#
# ami-8328bbf0
#
# Your Identity is:
#
# capgemini-d3d9446802a44259755d38e6d163e820
#
variable "aws_access_key" {}
variable "aws_secret_key" {}
variable "aws_region" {
default = "eu-west-1"
}
provider "aws" {
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
region = "${var.aws_region}"
}
resource "aws_instance" "web" {
count = "1"
ami = "ami-8328bbf0"
instance_type = "t2.micro"
subnet_id = "subnet-51ab1e09"
vpc_security_group_ids = [ "sg-01272d66" ]
tags {
Identity = "capgemini-d3d9446802a44259755d38e6d163e820"
Name = "i-hope-this-works"
Test = "test"
}
}
output "public_ip" {
value = ["${aws_instance.web.*.public_ip}"]
}
output "public_dns" {
value = ["${aws_instance.web.*.public_dns}"]
}