To start with serverless deployments, i.e., to start testing and deploying AWS Lambda functions, we can do it many ways like AWS Cloudformation, AWS SAM CLI etc
This post is to explain and detail about the steps to install AWS SAM CLI in your EC2 instance, which is Amazon Linux
What is AWS SAM CLI:
Getting Started:
- AWS account & user login access
- Access to EC2 instances of Amazon linux with Lambda access, as well
Steps to get AWS SAM CLI installed:
- Login to the EC2 instance where AWS SAM CLI is planned to be installed
- Apply command "sudo pip install aws-sam-cli". This doesnt work as we need PIP
- to install PIP, first we need to install epel-release; In Amazon linux, epel-release is bundled in amazon-linux-extras
- Now install with "sudo amazon-linux-extras install epel" as above
- Install aws-sam-cli but raises below error
- As the above message says that Python 2.7 is no longer supported for running SAM Applications, let us upgrade the Python version and see how this works
- sudo pip install python3
- Now upgrade SAM, if required
- Initiate SAM
This is an prolonged mode of installing AWS SAM CLI, ideally it is better to proceed in this sequence
- Update the instance using "sudo yum update"
- Apply Python3 using "sudo yum install python3
- Now install aws-sam-cli using above steps
No comments:
Post a Comment