Working with AWS Beanstalk using the command line in Unix/Linux
Working with AWS Beanstalk using the command line in Unix/Linux
AWS Elastic Beanstalk is an easy – to-use service for deploying and scaling online applications and services developed using Java .NET, PHP, Node.js, Python, Ruby, Go or Docker on Apache, Nginx, Passenger.


Just upload your code and Elastic Beanstalk automatically deploys: allocate resources, work load balancing, auto-scaling to application health monitoring. However, you retain full control over the AWS resources for your application and at any time can access them.
Additional charge for Elastic Beanstalk will not be charged – you pay only for the AWS resources needed to store and work applications.
Working with AWS Beanstalk using the command line in Unix/Linux
Install the AWS CLI:
Installing the AWS CLI in Unix/Linux
Open the config:
# vim ~/.aws/credentials
Write down the keys. For example:
[Your_acc_name] aws_access_key_id = XXXXXXXXXXXXXXXXXXXXXXXXX aws_secret_access_key = YYYYYYYYYYYYYYYYYYYY
Where:
- Your_acc_name — the name for the account. Then you can use it.
- aws_access_key_id — Key.
- aws_secret_access_key is Another key.
PS: of Course you can use the utility to generate the account, but I prefer it this way and edit the file.
Create application-and the BeanStalk
To create app in beanstalk-e, run:
$ aws elasticbeanstalk create-application --region=us-west-2 --application-name=test
Viewing application-s in BeanStalk
To view all created aplikasinya in instance a team:
$ aws elasticbeanstalk describe-applications
If the output is large, you can use a filter such as:
$ aws elasticbeanstalk describe-applications | grep -E "test"
The removal of the application-and the BeanStalk
To remove the app, you can:
$ aws elasticbeanstalk delete-application --application-name test --region=us-west-2
The selection of available stack-solyushenov in BeanStalk
Looking for the necessary stack:
$ aws elasticbeanstalk list-available-solution-stacks
Graham need:
$ aws elasticbeanstalk list-available-solution-stacks| grep -E "Docker"
The creation of the environment and the BeanStalk
Applikason ready, now it is necessary to create environment:
$aws elasticbeanstalk create-environment --application-name test --environment-name staging --solution-stack-name "64bit Amazon Linux 2018.03 v2.11.5 running Multi-container Docker 18.06.1-ce (Generic)" --region us-west-2
Or options you can pour from a file:
$ aws elasticbeanstalk create-environment --application-name test --environment-name staging --solution-stack-name "64bit Amazon Linux 2018.03 v2.11.5 running Multi-container Docker 18.06.1-ce (Generic)" --option-settings file://options.json --region us-west-2
To view the environment s in BeanStalk
To view environment, run:
$ aws elasticbeanstalk describe-environments
Also, you can use filters if necessary.
Destruction of environment and the BeanStalk
To remove the environment, run:
$ aws elasticbeanstalk delete-environment --environment-name staging --region=us-west-2
Update the environment-and the BeanStalk
Perform deployment to a specific version:
$ aws elasticbeanstalk update-environment --application-name test --environment-name staging --version-label v1 --region us-west-2
PS: versioning is below.
Creation application-version-Yu BeanStalk
Create a new version of the application kit applications:
$ aws elasticbeanstalk create-application-version --application-name test --version-label v1 --source-bundle S3Bucket="some_s3_bucket_name",S3Key="deployment.zip" --auto-create-application --region us-west-2
Where:
- some_s3_bucket_name — the name of the bucket where the zip-archive (deployment.zip).
- deployment.zip Archive with everything you need to deploy applications (config, configuration, code …).
View application-version-and BeanStalk
To get information about aplikeyshen versions, run:
$ aws elasticbeanstalk describe-application-versions
To get help, run the command:
$ aws elasticbeanstalk help
That’s all the article “using AWS Beanstalk command line in Unix/Linux” is completed.