1
0
Fork 0
terraform-training/module1/module1.tf

20 lines
337 B
Terraform
Raw Normal View History

2020-05-13 10:26:38 +02:00
provider "aws" {
region = "eu-west-2"
}
2020-05-13 10:45:51 +02:00
variable "instance_name" {}
resource "aws_instance" "instance1" {
2020-05-13 10:26:38 +02:00
ami = "ami-01a6e31ac994bbc09"
instance_type = "t2.micro"
key_name = "cedric"
tags = {
2020-05-13 10:45:51 +02:00
Name = "${var.instance_name}"
2020-05-13 10:26:38 +02:00
}
}
2020-05-13 10:45:51 +02:00
2020-05-13 11:49:50 +02:00
output "instance1_public_ip" {
value = aws_instance.instance1.public_ip
}