Showing posts with label aws cli elastic beanstalk. Show all posts
Showing posts with label aws cli elastic beanstalk. Show all posts

AWS CLI Elastic Beanstalk cheat sheet

In our last post we have seen how to use EB CLI for managing elastic beanstalk through command line.  But, you can also manage elastic beanstalk using traditional AWS CLI. In this post you will find  AWS CLI cheat sheet for the same.
If you are new to Elastic Beanstalk, it’s recommended that you go through this free AWS Elastic Beanstalk crash course.
Below are the major commands used frequently while managing the elastic beanstalk environment.
To check the availability of a CNAME
aws elasticbeanstalk check-dns-availability --cname-prefix my-cname
To create a new application
aws elasticbeanstalk create-application --application-name CldVdsApp --description "my application"
Compose Environments
 aws elasticbeanstalk compose-environments --application-name media-library --group-name dev --version-labels front-v1 worker-v1
To create a new environment for an application
The following command creates a new environment for version “v1” of a java application named “CldVdsApp”:
aws elasticbeanstalk create-environment --application-name CldVdsApp --environment-name my-env --cname-prefix CldVdsApp --version-label v1 --solution-stack-name "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8"
To specify a JSON file to define environment configuration options
The following create-environment command specifies that a JSON file with the name myoptions.jsonshould be used to override values obtained from the solution stack or the configuration template:
aws elasticbeanstalk create-environment --environment-name sample-env --application-name CldVdsApp --option-settings file://myoptions.json
To create a storage location
The following command creates a storage location in Amazon S3:
aws elasticbeanstalk create-storage-location
To abort a deployment
aws elasticbeanstalk abort-environment-update --environment-name my-env
To delete an application
The following command deletes an application named CldVdsApp:
aws elasticbeanstalk delete-application --application-name CldVdsApp
You can refer the complete set of AWS CLI for elastic beanstalk on this link.
Note:- All the above commands are taken from different AWS CLI reference guides and put in one place over here. Please run the commands after due diligence as we won’t be responsible for any mistakes in executing the commands and it’s consequences.  If you have any concern or query feel free to contact us or comment below.

AWS EB CLI Cheat Sheet - Elastic Beanstalk

In this post we will discuss about the Elastic Beanstalk CLI called EB CLI.
If you are new to Elastic Beanstalk, it’s recommended that you go through this free AWS Elastic Beanstalk crash course.
If you want to manage Elastic Beanstalk using traditional AWS CLI follow this post .
Installation
Follow these guides to install eb cli on Windows, Linux and MacOS .
Get help
eb -h
Initialize eb cli
eb init
It will ask questions:-
  • Default region
  • Access key details
  • Select existing application or create new.
  • Application name
  • Platform e.g. PHP, Python etc.
  • Setup ssh
  • Select keypair or create one.
Create environment
eb create
Check status
eb status
Check health information
eb health
Check events
eb events
Pull logs
eb logs
Open environment website in browser
eb open
Deploy Update
eb deploy
Check configuration options
eb config
Terminate environment
eb terminate
List  environments
eb list
Change current environment
eb use cldvds-env
Below are some other useful commands
eb abortCancel deployment
eb appversionManage EB application versions
eb cloneCreate clone of environment
eb consoleOpen environment in AWS console
eb labsExtra commands for experiment
eb localRun commands on local machine
eb platformManage platform
eb printenvShow environment variables
eb restorerebuild a terminated environment
eb scaleScaling the number of instances.
eb setenvSet environment variables
eb sshConnect to instance via ssh
eb swapSwap CNAME of two environments
eb tagsModify environment tags
eb upgradeUpdate the platform to most recent version
Above list is created by referring the AWS doc for elastic beanstalk cli . If you have any query or concern please feel free to contact us.