File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -142,13 +142,23 @@ nohup bash -c "
142
142
# Configure CloudWatch Logs if a log group is specified
143
143
if [ " $cloudwatch_logs_group " != " " ]; then
144
144
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
+
145
154
if command -v dpkg > /dev/null 2>&1 ; then
146
155
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
148
157
dpkg -i -E ./amazon-cloudwatch-agent.deb
149
158
rm amazon-cloudwatch-agent.deb
150
159
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
152
162
rpm -U ./amazon-cloudwatch-agent.rpm
153
163
rm amazon-cloudwatch-agent.rpm
154
164
fi
You can’t perform that action at this time.
0 commit comments