Creating environments with the EB CLI requires a service role. You can create a service role by creating
an environment in the Elastic Beanstalk console. If you don't have a service role,
the EB CLI attempts to create one when you run eb create.

The EB CLI returns a zero (0) exit code for all successful commands, and a non-zero exit code when it encounters
any error.

The following examples use an empty project folder named eb that was
initialized with the EB CLI for use with a sample Docker application.

eb create

To create your first environment, run eb
create and follow the prompts. If your project directory has source code
in it, the EB CLI will bundle it up and deploy it to your environment. Otherwise,
a sample
application will be used.

eb health

Use the eb health command to view health
information about the instances in your environment and the state of your environment
overall. Use the --refresh option to view health in an interactive view that
updates every 10 seconds.

eb logs

Use eb logs to pull logs from an instance in your environment. By
default, eb logs pull logs from the first instance launched and displays
them in standard output. You can specify an instance ID with the --instance
option to get logs from a specific instance.

The --all option pulls logs from all instances and saves them to
subdirectories under .elasticbeanstalk/logs.

When you run eb deploy, the EB CLI bundles up the contents of your
project directory and deploys it to your environment.

Note

If you have initialized a git repository in your project folder, the EB CLI will always
deploy the latest commit, even if you have pending changes. Commit your changes prior
to
running eb deploy to deploy them to your environment.

eb config

Take a look at the configuration options available for your running environment with
the
eb config command:

This command populates a list of available configuration options in a text editor.
Many of
the options shown have a null value, these are not set by default but can be
modified to update the resources in your environment. See Configuration Options for more information about these options.

eb terminate

If you are done using the environment for now, use eb terminate to
terminate it.