From 752f20fa276f029d1f7d5a36820e9929abc0446f Mon Sep 17 00:00:00 2001 From: Michael Li Date: Tue, 24 Oct 2023 18:20:02 -0400 Subject: [PATCH] test(e2e): Wait until target ec2 instance is ready to be used (#3910) --- enos/modules/aws_target/main.tf | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/enos/modules/aws_target/main.tf b/enos/modules/aws_target/main.tf index 2c11e11384..5f99d8a83f 100644 --- a/enos/modules/aws_target/main.tf +++ b/enos/modules/aws_target/main.tf @@ -79,6 +79,20 @@ resource "aws_instance" "target" { }) } +resource "enos_remote_exec" "wait" { + for_each = { + for idx, instance in aws_instance.target : idx => instance + } + + inline = ["cloud-init status --wait"] + + transport = { + ssh = { + host = aws_instance.target[each.key].public_ip + } + } +} + output "target_ips" { value = aws_instance.target.*.private_ip }