Skip to content

Commit 0dde623

Browse files
committed
CW amd fix
1 parent bb72f09 commit 0dde623

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/ec2_gha/scripts/runner-setup.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,23 @@ nohup bash -c "
142142
# Configure CloudWatch Logs if a log group is specified
143143
if [ "$cloudwatch_logs_group" != "" ]; then
144144
log "Installing CloudWatch agent"
145+
146+
# Detect architecture for CloudWatch agent
147+
ARCH=$(uname -m)
148+
if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
149+
CW_ARCH="arm64"
150+
else
151+
CW_ARCH="amd64"
152+
fi
153+
145154
if command -v dpkg >/dev/null 2>&1; then
146155
wait_for_dpkg_lock
147-
wget -q https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb
156+
wget -q https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/${CW_ARCH}/latest/amazon-cloudwatch-agent.deb
148157
dpkg -i -E ./amazon-cloudwatch-agent.deb
149158
rm amazon-cloudwatch-agent.deb
150159
elif command -v rpm >/dev/null 2>&1; then
151-
wget -q https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm
160+
# Note: For RPM-based systems, the path structure might differ
161+
wget -q https://s3.amazonaws.com/amazoncloudwatch-agent/amazon_linux/${CW_ARCH}/latest/amazon-cloudwatch-agent.rpm
152162
rpm -U ./amazon-cloudwatch-agent.rpm
153163
rm amazon-cloudwatch-agent.rpm
154164
fi

0 commit comments

Comments
 (0)