Skip to content

Commit

Permalink
Add swap space to the EC2 instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Pozo committed Jul 4, 2024
1 parent 02773dc commit 44daf74
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions terraform/init.sh.tfpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ echo ECS_CLUSTER="${ecs_cluster_name}" >> /etc/ecs/ecs.config
yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
systemctl start amazon-ssm-agent
systemctl enable amazon-ssm-agent

# swapping 2G
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

0 comments on commit 44daf74

Please sign in to comment.