From c23b5129a72c8ba8ea4e004a5a36a64a8fc76382 Mon Sep 17 00:00:00 2001 From: Rishabh Singh Date: Fri, 9 Feb 2024 12:05:49 -0800 Subject: [PATCH] install yq bin as per cpu arch (#104) Signed-off-by: Rishabh Singh --- lib/infra/infra-stack.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/infra/infra-stack.ts b/lib/infra/infra-stack.ts index 80fe0dc0560..a07ea94a538 100644 --- a/lib/infra/infra-stack.ts +++ b/lib/infra/infra-stack.ts @@ -657,8 +657,9 @@ export class InfraStack extends Stack { const cfnInitConfig: InitElement[] = [ InitPackage.yum('amazon-cloudwatch-agent'), - InitCommand.shellCommand('sudo wget -nv https://github.com/mikefarah/yq/releases/download/v4.40.5/yq_linux_amd64 ' - + '-O /usr/bin/yq && sudo chmod +x /usr/bin/yq'), + InitCommand.shellCommand('arc=$(arch); if [ "$arc" == "aarch64" ]; then dist="arm64"; else dist="amd64"; fi; ' + + 'sudo wget -nv https://github.com/mikefarah/yq/releases/download/v4.40.5/yq_linux_$dist ' + + '-O /usr/bin/yq && sudo chmod 755 /usr/bin/yq'), CloudwatchAgent.asInitFile('/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json', { agent: {