From f7c9db5624cd60b1f2fe04a48a9deaee5be0d7ae Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Fri, 6 Sep 2019 15:49:18 -0400 Subject: [PATCH] e2e: tag instances with origin (#6293) When multiple developers are working on e2e testing, it helps to be able to identify which infrastructure belongs to which Nomad SHA and which developer. This adds tags to the EC2 instances. --- e2e/terraform/compute.tf | 5 ++++- e2e/terraform/main.tf | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/e2e/terraform/compute.tf b/e2e/terraform/compute.tf index 230ac8b36..13e0f0938 100644 --- a/e2e/terraform/compute.tf +++ b/e2e/terraform/compute.tf @@ -37,6 +37,8 @@ resource "aws_instance" "server" { tags { Name = "${local.random_name}-server-${count.index}" ConsulAutoJoin = "auto-join" + SHA = "${var.nomad_sha}" + User = "${data.aws_caller_identity.current.arn}" } user_data = "${data.template_file.user_data_server.rendered}" @@ -83,6 +85,8 @@ resource "aws_instance" "client" { tags { Name = "${local.random_name}-client-${count.index}" ConsulAutoJoin = "auto-join" + SHA = "${var.nomad_sha}" + User = "${data.aws_caller_identity.current.arn}" } ebs_block_device = { @@ -126,4 +130,3 @@ resource "aws_instance" "client" { } } } - diff --git a/e2e/terraform/main.tf b/e2e/terraform/main.tf index 544f84b04..0fc887e62 100644 --- a/e2e/terraform/main.tf +++ b/e2e/terraform/main.tf @@ -71,6 +71,8 @@ data "aws_ami" "main" { } +data "aws_caller_identity" "current" {} + output "servers" { value = "${aws_instance.server.*.public_ip}" }