Skip to content

Commit 86ff583

Browse files
authored
fix metricbeat aws module terraform and log errors (#47667)
Fix the metricbeat aws module terraform to ensure it uses a AMI compatible with the VM's platform. Fix the `.buildkite/scripts/initCloudEnv.sh` to always log the output of `terraformSetup`
1 parent d4ec033 commit 86ff583

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.buildkite/scripts/initCloudEnv.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,17 @@ terraformSetup() {
5353

5454
while true; do
5555
echo "~~~ Setting up Terraform"
56-
out=$(terraformApply 2>&1)
56+
terraformApply 2>&1
5757
exit_code=$?
5858

59-
echo "$out"
60-
6159
if [ $exit_code -eq 0 ]; then
6260
break
6361
else
6462
retries=$((retries + 1))
6563

6664
if [ $retries -gt $max_retries ]; then
6765
teardown
68-
echo "+++ Terraform init & apply failed: $out"
66+
echo "+++ Terraform init & apply failed: check the logs above for details."
6967
exit 1
7068
fi
7169

x-pack/metricbeat/module/aws/terraform.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,8 @@ data "aws_ami" "latest-amzn" {
7979
"amzn2-ami-hvm-*",
8080
]
8181
}
82+
filter {
83+
name = "architecture"
84+
values = ["x86_64"]
85+
}
8286
}

0 commit comments

Comments
 (0)