In the previous post, we have seen how to install AWS SAM CLI without using Docker image as suggested in AWS Documentation page.
Now, let us use the method recommended in AWS documentation page
- AWS account and log in access
- required access to EC2 with Amazon Linux distribution
Steps involved in installing SAM CLI:
- Connect to the EC2 amazon linux distribution
- Run sudo yum update -y; luckily, my instance did have nothing to update
- Install docker image from amazon-linux-extra
- Add ec2-user to Docker service ; checking "docker ps" immediately raises 'Permission denied' error. To resolve this, we need to restart or logout & login again and try
- check Docker command without sudo(after restarting the session or logout and retry)
- as a pre-requisite, AWS documenation page recommends installing git; hence we deploy git as below
- Install homebrew
- Add variables for brew into ~/.bash_profile or ~/.profile as below and check brew version
- Install SAM using brew and check SAM version
- Initiate SAM
Now, we have successfully installed and initiated SAM CLI installed as per AWS help page.