provider "aws" { region = "eu-west-2" } variable "instance_name" {} resource "aws_instance" "instance1" { ami = "ami-01a6e31ac994bbc09" instance_type = "t2.micro" key_name = "cedric" tags = { Name = "${var.instance_name}" } } output "instance1_public_ip" { value = aws_instance.instance1.public_ip }