Configure Labels

Aug 2017

When creating an EC2 Instance, there are some labels that can be set, these don't seem particularly important, until you have a lot of instances to manage, then you suddenly realise the value of these labels. If you have a lot of EC2 Instances and have not labelled them, you will have a hard time working out which EC2 Instance is performing what task(s).
Below is a single EC2 Instance in AWS, and you can see the two labels that are in the Terraform script.
On the left we have 'Name' (click the image to enlarge it) and on the right we have the 'Key Name'. We can see these in the Terraform script.
<sxh text; first-line: 01; highlight: [10,13];> provider “aws” {

access_key = "JLJBK63HMPBC7DC150PA"
secret_key = "K7H2g33xPj6F7zBNcFGTeL5SlbjTsDNA/9nA2caa"
region = "eu-west-2"

}

resource “aws_instance” “example” {

ami = "ami-40a8bf24"
instance_type = "t2.micro"
key_name = "TestWebSvr"
security_groups= ["launch-wizard-1"]
tags {
Name = "terraform-instance"
}

} </sxh>