AWS Classroomnotes 15/Oct/2022

AWS Elastic Beanstalk from Command Line

  • Lets take a sample python based application and deploy this into elastic beanstalk
  • I would like to deploy from command line

Setting up AWS CLI

curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
  • Ubuntu Linux:
    • Lets create the keypair with pem file
      Preview
      Preview
      Preview
    • Create ec2 instance with size t2.micro with key pair created above
      Preview
      Preview
      Preview
      Preview
  • Now ensure you have Windows Powershell (latest update on Windows 10/Windows 11). If you are working on earlier versions of windows ensure atlest gitbash is installed. Refer Here
  • For Mac users => Launch Terminal
  • The command to login ssh -i <path to pem> ubuntu@<publicip>
    Preview
  • Installing AWS CLI on ubuntu:
sudo apt update
sudo apt install unzip -y
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
  • Now verify the installation using aws --version
    Preview
  • Now create an IAM user Refer Here
  • Login into ec2 instance and execute aws configure. Enter access key, secret access key, region (us-west-2)
  • Now we need to verify access aws s3 ls this command should not throw error
  • Now we need to install elastic beanstalk cli eb-cli
    • Approach 1 Refer Here
    • Approach 2 Refer Here
      sudo apt install python3-pip -y
    • Now install eb-cli pip install awsebcli --upgrade --user
    • Now we need to set the path
    • Add export PATH=~/.local/bin:$PATH to ~/.bashrc
    • Now logout and login eb --version
      Preview
  • New to linux: Understand the following
    • sudo
    • apt
    • PATH variable and its importance
    • vi editor

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner