# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 sudo apt update && sudo apt upgrade -y sudo apt install unzip apt-transport-https ca-certificates curl gnupg lsb-release -y curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg -y sudo apt update #install AWS CLI sudo curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" sudo unzip awscliv2.zip sudo ./aws/install #create random string for password VHPW=$(echo $RANDOM | md5sum | head -c 20) #get stackname created by user data script and update SSM parameter name with this to make it unique STACKNAME=$(> docker-compose.yml' echo "@reboot root (cd /usr/games/serverconfig/ && docker-compose up)" > /etc/cron.d/awsgameserver sudo docker-compose up