Skip to content

Commit

Permalink
ci: fix EC2 install script (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
kb-newrelic authored Jan 29, 2025
1 parent 8e6438a commit 0a15702
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/terraform/modules/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ resource "aws_instance" "ubuntu" {
iam_instance_profile = aws_iam_instance_profile.s3_read_access.name


user_data = <<-EOF
user_data_replace_on_change = true
user_data = <<-EOF
#!/bin/bash
echo 'Configuring swap file to ensure system.paging.usage metric gets published'
dd if=/dev/zero of=/swapfile bs=1M count=128
Expand All @@ -134,7 +135,7 @@ resource "aws_instance" "ubuntu" {
unzip -q awscliv2.zip
./aws/install
deb_package_basepath='s3://${var.releases_bucket_name}/opentelemetry-collector-releases/${var.collector_version}/'
latest_deb_package_filename=$(aws s3 ls $${deb_package_basepath} | sort -r | grep 'amd64.deb' | awk '{print $NF}')
latest_deb_package_filename=$(aws s3 ls $${deb_package_basepath} | sort -r | grep '${var.collector_distro}' | grep 'amd64.deb$' | head -n1 | awk '{print $NF}')
echo "Installing collector from: $${deb_package_basepath}$${latest_deb_package_filename}"
aws s3 cp "$${deb_package_basepath}$${latest_deb_package_filename}" /tmp/collector.deb
dpkg -i /tmp/collector.deb
Expand Down

0 comments on commit 0a15702

Please sign in to comment.