Installing CloudWatch agent via install.sh - no package available

We have a GameLift deployment running on a Linux host and I’m trying to get the CloudWatch agent installed during deployment. I have been able to successfully remote into a Fleet instance and install the agent manually using sudo yum install amazon-cloudwatch-agent, but when I execute that command from an install.sh script, it results in this error:

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package amazon-cloudwatch-agent
available.
Error: Nothing to do

Notably, when I install manually, this is displayed:

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core
Resolving Dependencies
→ Running transaction check
—> Package amazon-cloudwatch-agent.x86_64 0:1.247347.4-1.amzn2 will be installed

Does anyone know if there’s some timing involved here with the amzn2-core package not being available? Can the CloudWatch agent be installed using the install.sh file?

Thanks.

-Steve

Hi @SteveShiny ,

Is this on an AMAZON_LINUX or AMAZON_LINUX _2 fleet?

Can you try downloading / installing via S3 download link instead to get unblocked?
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/install-CloudWatch-Agent-commandline-fleet.html

See example: https://github.com/aws-samples/aws-gamelift-and-serverless-backend-sample/blob/master/LinuxServerBuild/install.sh#L4-L5

This was on an AMAZON_LINUX _2 fleet and that’s what I ended up trying yesterday. That indeed solved my problem. The install script was able to download, install, and configure.

Thanks.