

# EB CLI command reference
EB CLI commands

You can use the Elastic Beanstalk command line interface (EB CLI) to perform a variety of operations to deploy and manage your Elastic Beanstalk applications and environments. The EB CLI integrates with Git if you want to deploy application source code that is under Git source control. For more information, see [Setting up the EB command line interface (EB CLI) to manage Elastic Beanstalk](eb-cli3.md) and [Using the EB CLI with Git](eb3-cli-git.md).

**Topics**
+ [

# Common options
](eb3-cmd-options.md)
+ [

# **eb abort**
](eb3-abort.md)
+ [

# **eb appversion**
](eb3-appversion.md)
+ [

# **eb clone**
](eb3-clone.md)
+ [

# **eb codesource**
](eb3-codesource.md)
+ [

# **eb config**
](eb3-config.md)
+ [

# **eb console**
](eb3-console.md)
+ [

# **eb create**
](eb3-create.md)
+ [

# **eb deploy**
](eb3-deploy.md)
+ [

# **eb events**
](eb3-events.md)
+ [

# **eb health**
](eb3-health.md)
+ [

# **eb init**
](eb3-init.md)
+ [

# **eb labs**
](eb3-labs.md)
+ [

# **eb list**
](eb3-list.md)
+ [

# **eb local**
](eb3-local.md)
+ [

# **eb logs**
](eb3-logs.md)
+ [

# **eb migrate**
](eb3-migrate.md)
+ [

# **eb open**
](eb3-open.md)
+ [

# **eb platform**
](eb3-platform.md)
+ [

# **eb printenv**
](eb3-printenv.md)
+ [

# **eb restore**
](eb3-restore.md)
+ [

# **eb scale**
](eb3-scale.md)
+ [

# **eb setenv**
](eb3-setenv.md)
+ [

# **eb ssh**
](eb3-ssh.md)
+ [

# **eb status**
](eb3-status.md)
+ [

# **eb swap**
](eb3-swap.md)
+ [

# **eb tags**
](eb3-tags.md)
+ [

# **eb terminate**
](eb3-terminate.md)
+ [

# **eb upgrade**
](eb3-upgrade.md)
+ [

# **eb use**
](eb3-use.md)

# Common options


You can use the following options with all EB CLI commands.


****  

|  Name  |  Description  | 
| --- | --- | 
|   `--debug`   |  Print information for debugging.  | 
|   `-h`, `--help`   |  Show the Help message. Type: String Default: None  | 
|   `--no-verify-ssl`   |  Skip SSL certificate verification. Use this option if you have issues using the CLI with a proxy.  | 
|   `--profile`   |  Use a specific profile from your Amazon credentials file.  | 
|   `--quiet`   |  Suppress all output from the command.  | 
|   `--region`   |  Use the specified region.  | 
|   `-v`, `--verbose`   |  Display verbose information.   | 

# **eb abort**


## Description


Cancels an upgrade when environment configuration changes to instances are still in progress.

**Note**  
If you have more than two environments that are undergoing a update, you are prompted to select the name of the environment for which you want to roll back changes.

## Syntax


 **eb abort** 

 **eb abort *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


The command shows a list of environments currently being updated and prompts you to choose the update that you want to abort. If only one environment is currently being updated, you do not need to specify the environment name. If successful, the command reverts environment configuration changes. The rollback process continues until all instances in the environment have the previous environment configuration or until the rollback process fails.

## Example


The following example cancels the platform upgrade.

```
$ eb abort
Aborting update to environment "tmp-dev".
<list of events>
```

# **eb appversion**


## Description


The EB CLI `appversion` command manages your Elastic Beanstalk [application versions](concepts.md#concepts-version). You can create a new version of the application without deploying, delete a version of the application, or create the [application version lifecycle policy](applications-lifecycle.md). If you invoke the command without any options, it enters the [interactive mode](#eb3-appversion-interactive).

Use the `--create` option to create a new version of the application.

Use the `--delete` option to delete a version of the application.

Use the `lifecycle` option to display or create the application version lifecycle policy. For more information, see [Configuring application version lifecycle settings](applications-lifecycle.md).

## Syntax


 **eb appversion** 

 **eb appversion [-c \$1 --create]** 

 **eb appversion [-d \$1 --delete] *version-label*** 

 **eb appversion lifecycle [-p \$1 --print]** 

## Options



****  

|  Name  |  Description Type: String  | 
| --- | --- | 
|  -a *application-name* or --application\$1name *application-name*  | The name of the application. If an application with the specified name isn't found, the EB CLI creates an application version for a new application. Only applicable with the `--create` option. Type: String  | 
|  -c or --create  | Create a [new version](concepts.md#concepts-version) of the application. | 
|  -d *version-label* or --delete *version-label*  | Delete the version of the application that is labeled version-label. | 
|  `-l` *version\$1label* or `--label` *version\$1label*  |  Specify a label to use for the version that the EB CLI creates. If you don't use this option, the EB CLI generates a new unique label. If you provide a version label, make sure that it's unique. Only applicable with the `--create` option. Type: String  | 
|  lifecycle  | Invoke the default editor to create a new application version lifecycle policy. Use this policy to avoid reaching the [application version quota](https://docs.amazonaws.cn/general/latest/gr/elasticbeanstalk.html#limits_elastic_beanstalk). | 
|  lifecycle -p or lifecycle --print  | Display the current application lifecycle policy. | 
|  `-m` "*version\$1description*" or `--message` "*version\$1description*"  |  The description for the application version. It's enclosed in double quotation marks. Only applicable with the `--create` option. Type: String  | 
|  `-p` or `--process`  |  Preprocess and validate the environment manifest and configuration files in the source bundle. Validating configuration files can identify issues. We recommend you do this before deploying the application version to the environment. Only applicable with the `--create` option.  | 
|  `--source codecommit/repository-name/branch-name`  |  CodeCommit repository and branch.  Only applicable with the `--create` option.  | 
|  `--staged`  |  Use the files staged in the git index, instead of the HEAD commit, to create the application version. Only applicable with the `--create` option.  | 
|  `--timeout` *minutes*  |  The number of minutes before the command times out. Only applicable with the `--create` option.  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Using the command interactively


If you use the command without any arguments, the output displays the versions of the application. They're listed in reverse chronological order, with the lastest version listed first. See the **Examples** section for examples of what the screen looks like. Note that the status line is displayed at the bottom. The status line displays context-sensitive information.

Press `d` to delete an application version, press `l` to manage the lifecycle policy for your application, or press `q` to quit without making any changes.

**Note**  
If the version is deployed to any environment, you can't delete that version.

## Output


The command with the `--create` option displays a message confirming that the application version was created.

The command with the `--delete` *version-label* option displays a message confirming that the application version was deleted.

## Examples


The following example shows the interactive window for an application with no deployments.

![\[Application window showing version history with three entries and no current deployment.\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/images/InteractiveModeNoEnvironment.png)


The following example shows the interactive window for an application with the fourth version, with version label **Sample Application**, deployed.

![\[Application versions table showing 4 versions, with the latest labeled "Sample Application" deployed 2 minutes ago.\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/images/InteractiveModeWithEnvironment.png)


The following example shows the output from an **eb appversion lifecycle -p** command, where *ACCOUNT-ID* is the user's account ID:

```
Application details for: lifecycle
  Region: sa-east-1
  Description: Application created from the EB CLI using "eb init"
  Date Created: 2016/12/20 02:48 UTC
  Date Updated: 2016/12/20 02:48 UTC
  Application Versions: ['Sample Application']
  Resource Lifecycle Config(s):
    VersionLifecycleConfig:
      MaxCountRule:
        DeleteSourceFromS3: False
        Enabled: False
        MaxCount: 200
      MaxAgeRule:
        DeleteSourceFromS3: False
        Enabled: False
        MaxAgeInDays: 180
    ServiceRole: arn:aws-cn:iam::ACCOUNT-ID:role/aws-elasticbeanstalk-service-role
```

# **eb clone**


## Description


Clones an environment to a new environment so that both have identical environment settings.

**Note**  
By default, regardless of the solution stack version of the environment from which you create the clone, the **eb clone** command creates the clone environment with the most recent solution stack. You can suppress this by including the `--exact` option when you run the command.



**Important**  
Cloned Elastic Beanstalk environments do not carry over the security groups for ingress, leaving the environment open to all internet traffic. You’ll need to reestablish ingress security groups for the cloned environment.  
You can see resources that may not be cloned by checking the drift status of your environment configuration. For more information, see [Detect drift on an entire CloudFormation stack ](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/detect-drift-stack.html) in the *Amazon CloudFormation User Guide*.



## Syntax


 **eb clone** 

 **eb clone *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `-n` *string* or `--clone_name` *string*  |  Desired name for the cloned environment.  | 
|  `-c` *string* or `--cname` *string*  |  Desired CNAME prefix for the cloned environment.  | 
|  `--envvars`  |  Environment properties in a comma-separated list with the format *name*=*value*. Type: String Constraints: [\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/eb3-clone.html)  | 
|  `--exact`  |  Prevents Elastic Beanstalk from updating the solution stack version for the new clone environment to the most recent version available (for the original environment's platform).  | 
|  `--scale` *number*  |  The number of instances to run in the clone environment when it is launched.  | 
|  `--tags` *name*=*value*  |  [Tags](using-features.tagging.md) for the resources in your environment in a comma-separated list with the format *name*=*value*.  | 
|  `--timeout`  |  The number of minutes before the command times out.  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


If successful, the command creates an environment that has the same settings as the original environment or with modifications to the environment as specified by any **eb clone** options.

## Example


The following example clones the specified environment.

```
$ eb clone
Enter name for Environment Clone
(default is tmp-dev-clone):
Enter DNS CNAME prefix
(default is tmp-dev-clone):
Environment details for: tmp-dev-clone
  Application name: tmp
  Region: us-west-2
  Deployed Version: app-141029_144740
  Environment ID: e-vjvrqnn5pv
  Platform: 64bit Amazon Linux 2014.09 v1.0.9 running PHP 5.5
  Tier: WebServer-Standard-1.0
  CNAME: tmp-dev-clone.elasticbeanstalk.com
  Updated: 2014-10-29 22:00:23.008000+00:00
Printing Status:
2018-07-11 21:04:20    INFO: createEnvironment is starting.
2018-07-11 21:04:21    INFO: Using elasticbeanstalk-us-west-2-888888888888 as Amazon S3 storage bucket for environment data.
...
2018-07-11 21:07:10    INFO: Successfully launched environment: tmp-dev-clone
```

# **eb codesource**


## Description


Configures the EB CLI to deploy from a CodeCommit repository, or disables CodeCommit integration and uploads the source bundle from your local machine.



**Note**  
Some Amazon Regions don't offer CodeCommit. The integration between Elastic Beanstalk and CodeCommit doesn't work in these Regions.  
For information about the Amazon services offered in each Region, see [Region Table](http://www.amazonaws.cn/about-aws/global-infrastructure/regional-product-services/).

## Syntax


**eb codesource** 

**eb codesource codecommit**

**eb codesource local**

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


**eb codesource** prompts you to choose between CodeCommit integration and standard deployments.

**eb codesource codecommit** initiates interactive repository configuration for CodeCommit integration.

**eb codesource local** shows the original configuration and disables CodeCommit integration.

## Examples


Use **eb codesource codecommit** to configure CodeCommit integration for the current branch.

```
~/my-app$ eb codesource codecommit
Select a repository
1) my-repo
2) my-app
3) [ Create new Repository ]
(default is 1): 1

Select a branch
1) mainline
2) test
3) [ Create new Branch with local HEAD ]
(default is 1): 1
```

Use **eb codesource local** to disable CodeCommit integration for the current branch.

```
~/my-app$ eb codesource local
Current CodeCommit setup:
  Repository: my-app
  Branch: mainline
Default set to use local sources
```

# **eb config**


## Description


Manages the active [configuration](concepts.md#concepts-environmentconfig) settings and [saved configurations](concepts.md#concepts-configuration) of your environment. You can use this command to upload, download, or list the saved configurations of your environment. You can also use it to download, display, or update its active configuration settings. 



If the root directory contains a `platform.yaml` file specifying a custom platform, this command also changes the builder configuration settings. This is done based on the values that are set in `platform.yaml`.

**Note**  
**eb config** doesn't show environment properties. To set environment properties that you can read from within your application, use [**eb setenv**](environment-configuration-methods-after.md#configuration-options-after-ebcli-ebsetenv) instead.

## Syntax


The following are parts of the syntax that's used for the **eb config** command to work with the active [configuration settings](concepts.md#concepts-environmentconfig) of your environment. For specific examples, see the [Examples](#eb3-configexample) section later in this topic.
+  **eb config** – Displays the active configuration settings of your environment in a text editor that you configured as the EDITOR environment variable. When you save changes to the file and close the editor, the environment is updated with the option settings that you saved in the file.
**Note**  
If you didn't configure an EDITOR environment variable, EB CLI displays your option settings in your default editor for YAML files.
+  **eb config *environment-name*** – Displays and updates the configuration for the named environment. The configuration is either displayed in a text editor that you configured or your default editor YAML files.
+ **eb config save** – Saves the active configuration settings for the current environment to `.elasticbeanstalk/saved_configs/` with the filename `[configuration-name].cfg.yml`. By default, the EB CLI saves the configuration settings with a *configuration-name* based on the environment name. You can specify a different configuration name by including the `--cfg` option with your desired configuration name when you run the command.

  You can tag your saved configuration using the `--tags` option.
+ **eb config `--display`** – Writes an environment's active configuration settings to *stdout *instead of a file. By default this displays the configuration settings to the terminal.
+ **eb config `--update configuration_string | file_path`** – Updates the active configuration settings for the current environment with the information that's specified in *configuration\$1string* or inside the file identified by *file\$1path*.

**Note**  
The `--display` and `--update` options provide flexibility for reading and revising an environment's configuration settings programmatically.

The following describes the syntax for using the **eb config** command to work with [saved configurations](concepts.md#concepts-configuration). For examples, see the [Examples](#eb3-configexample) section later in this topic.
+ **eb config get *config-name*** – Downloads the named saved configuration from Amazon S3.

  
+ **eb config delete *config-name* ** – Deletes the named saved configuration from Amazon S3. Also deletes it locally, if you already downloaded it.
+ **eb config list** – Lists the saved configurations that you have in Amazon S3.
+ **eb config put *filename*** – Uploads the named saved configuration to an Amazon S3 bucket. The *filename* must have the file extension `.cfg.yml`. To specify the file name without a path, you can save the file to the `.elasticbeanstalk` folder or to the `.elasticbeanstalk/saved_configs/` folder before you run the command. Alternatively, you can specify the *filename* by providing the full path.

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `--cfg config-name`  |  The name to use for a saved configuration. This option works with **eb config save** only.  | 
|  `-d` or `--display`  |  Displays the configuration settings for the current environment (writes to *stdout*). Use with the `--format` option to specify the output to be in JSON or YAML. If you don't specify, the output is in YAML format. This option only works if you use the **eb config** command without any of the other subcommands.  | 
|  `-f format_type` or `--format format_type`  |  Specifies display format. Valid values are JSON or YAML.  Defaults to YAML. This option works with the `--display` option only.  | 
|  `-﻿-﻿tags key1=value1[,key2=value2 ...]`  |  Tags to add to your saved configuration. When specifying tags in the list, specify them as key=value pairs and separate each one with a comma. For more information, see [Tagging saved configurations](environment-configuration-savedconfig-tagging.md). This option works with **eb config save** only.  | 
|  `--timeout timeout`  |  The number of minutes before the command times out.  | 
|  `-u configuration_string \| file_path` or `--update configuration_string \| file_path`  |  Updates the active configuration settings for the current environment. This option only works if you use the **eb config** command without any of the other subcommands. The `configuration_string \| file_path` parameter is of the type string. The string provides the list of namespaces and corresponding options to add to, update, or remove from the configuration settings for your environment. Alternatively, the input string can represent a file that contains the same information. To specify a file name, the input string must follow the format `"file://<path><filename>"`. To specify the file name without a `path`, save the file to the folder where you run the command. Alternatively, specify the filename by providing the full path. The configuration information must meet the following conditions. At least one of the sections, **OptionSettings** or **OptionsToRemove**, is required. Use **OptionSettings** to add or change options. Use **OptionsToRemove** to remove options from a namespace. For specific examples, see the [Examples](#eb3-configexample) section later in this topic. 

**Example**  
*YAML Format*  

```
OptionSettings:
  namespace1:
    option-name-1: option-value-1
    option-name-2: option-value-2
    ...
OptionsToRemove:
  namespace1:
    option-name-1
    option-name-2
    ...
``` 

**Example**  
*JSON Format*  

```
{
   "OptionSettings": {
      "namespace1": {
         "option-name-1": "option-value-1",
         "option-name-2": "option-value-2",
         ...
      }
   },
   "OptionsToRemove": {
      "namespace1": {
         "option-name-1",
         "option-name-2",
         ...
      }
   }
}
```  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


If the **eb config** or **eb config *environment-name*** command is run successfully with no subcommands or options added, the command displays your current option settings in the text editor that you configured as the EDITOR environment variable. If you didn't configure an EDITOR environment variable, EB CLI displays your option settings in your default editor for YAML files.

When you save changes to the file and close the editor, the environment is updated with the option settings that you saved in the file. The following output is displayed to confirm the configuration update.

```
$ eb config myApp-dev
    Printing Status:
    2021-05-19 18:09:45    INFO    Environment update is starting.
    2021-05-19 18:09:55    INFO    Updating environment myApp-dev's configuration settings.
    2021-05-19 18:11:20    INFO    Successfully deployed new configuration to environment.
```

If the command runs successfully with the `--display` option, it displays the configuration settings for the current environment (writes to *stdout*).

If the command runs successfully with the `get` parameter, the command displays the location of the local copy that you downloaded.

If the command runs successfully with the `save` parameter, the command displays the location of the saved file.

## Examples


This section describes how to change the text editor that you use to view and edit your option settings file.

For Linux and UNIX, the following example changes the editor to vim:

```
$ export EDITOR=vim
```

For Linux and UNIX, the following example changes the editor to whatever is installed at `/usr/bin/kate`.

```
$ export EDITOR=/usr/bin/kate
```

For Windows, the following example changes the editor to Notepad\$1\$1.

```
> set EDITOR="C:\Program Files\Notepad++\Notepad++.exe
```

This section provides examples for the **eb config** command when it's run with subcommands.

The following example deletes the saved configuration named `app-tmp`.

```
$ eb config delete app-tmp
```

The following example downloads the saved configuration with the name app-tmp from your Amazon S3 bucket.

```
$ eb config get app-tmp
```

The following example lists the names of saved configurations that are stored in your Amazon S3 bucket.

```
$ eb config list
```

The following example uploads the local copy of the saved configuration named app-tmp to your Amazon S3 bucket.

```
$ eb config put app-tmp
```

The following example saves configuration settings from the current running environment. If you don't provide a name to use for the saved configuration, then Elastic Beanstalk names the configuration file according to the environment name. For example, an environment named *tmp-dev* would be called `tmp-dev.cfg.yml`. Elastic Beanstalk saves the file to the `/.elasticbeanstalk/saved_configs/` folder.

```
$ eb config save
```

In the following example, the `--cfg` option is used to save the configuration settings from the environment tmp-dev to a file called `v1-app-tmp.cfg.yml`. Elastic Beanstalk saves the file to the folder `/.elasticbeanstalk/saved_configs/`. If you don't specify an environment name, Elastic Beanstalk saves configuration settings from the current running environment.

```
$ eb config save tmp-dev --cfg v1-app-tmp
```

This section provides examples for the **eb config** command when it's run without subcommands.

The following command displays the option settings of your current environment in a text editor.

```
$ eb config
```

The following command displays the option settings for the *my-env* environment in a text editor.

```
$ eb config my-env
```

The following example displays the options settings for your current environment. It outputs in the YAML format because no specific format was specified with the `--format` option.

```
$ eb config --display
```

The following example updates the options settings for your current environment with the specifications in the file named `example.txt`. The file is in either the YAML or JSON format. The EB CLI automatically detects the file format.
+  The Minsize option is set to 1 for the namespace `aws:autoscaling:asg`. 
+  The batch size for the namespace `aws:elasticbeanstalk:command` is set to 30%. 
+  It removes the option setting of *IdleTimeout: None* from the namespace `AWSEBV2LoadBalancer.aws:elbv2:loadbalancer`. 

```
$ eb config --update "file://example.txt"
```

**Example - filename: `example.txt` - YAML format**  

```
OptionSettings:
  'aws:elasticbeanstalk:command':
    BatchSize: '30'
    BatchSizeType: Percentage
  'aws:autoscaling:asg':
    MinSize: '1'
OptionsToRemove:
  'AWSEBV2LoadBalancer.aws:elbv2:loadbalancer':
    IdleTimeout
```

**Example - filename: `example.txt` - JSON format**  

```
{
    "OptionSettings": {
        "aws:elasticbeanstalk:command": {
            "BatchSize": "30",
            "BatchSizeType": "Percentage"
        },
        "aws:autoscaling:asg": {
            "MinSize": "1"
        }
    },
    "OptionsToRemove": {
        "AWSEBV2LoadBalancer.aws:elbv2:loadbalancer": {
            "IdleTimeout"
        }
    }
}
```

The following examples update the options settings for your current environment. The command sets the Minsize option to 1 for the`aws:autoscaling:asg` namespace.

**Note**  
These examples are specific to Windows PowerShell. They escape literal occurrences of the double-quote (`"`) character by preceding it with a slash (`\`) character. Different operating systems and command-line environments might have different escape sequences. For this reason, we recommend using the file option that's shown in the previous examples. Specifying the configuration options in a file doesn't require escaping characters and is consistent across different operating systems.

The following example is in JSON format. The EB CLI detects if the format is in JSON or YAML.

```
PS C:\Users\myUser\EB_apps\myApp-env>eb config --update '{\"OptionSettings\":{\"aws:autoscaling:asg\":{\"MaxSize\":\"1\"}}}'
```

The following example is in YAML format. To enter the YAML string in the correct format, the command includes spacing and end-of-line returns that are required in a YAML file.
+ End each line with the "enter" or "return" key.
+ Start the second line with two spaces, and start the third line with four spaces.

```
PS C:\Users\myUser\EB_apps\myApp-env>eb config --update 'OptionSettings:
>>  aws:autoscaling:asg:
>>    MinSize: \"1\"'
```

# **eb console**


## Description


Opens a browser to display the environment configuration dashboard in the Elastic Beanstalk Management Console.

If the root directory contains a `platform.yaml` file specifying a custom platform, this command also displays the builder environment configuration, as specified in `platform.yaml`, in the Elastic Beanstalk Management Console.

## Syntax


 **eb console** 

 **eb console *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  [Common options](eb3-cmd-options.md)  |  | 

# **eb create**


## Description


Creates a new environment and deploys an application version to it.

**Note**  
To use **eb create** on a .NET application, you must create a deployment package as described in [Creating a source bundle for a .NET application](applications-sourcebundle.md#using-features.deployment.source.dotnet), then set up the CLI configuration to deploy the package as an artifact as described in [Deploying an artifact instead of the project folder](eb-cli3-configuration.md#eb-cli3-artifact).
Creating environments with the EB CLI requires a [service role](concepts-roles-service.md). 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`.

You can deploy the application version from a few sources:
+ By default: From the application source code in the local project directory.
+ Using the `--version` option: From an application version that already exists in your application.
+ When your project directory doesn't have application code, or when using the `--sample` option: Deployed from a sample application, specific to your environment's platform.

## Syntax


**eb create**

**eb create *environment-name***

An environment name must be between 4 and 40 characters in length. It can only contain letters, numbers, and hyphens (-). An environment name can't begin or end with a hyphen.

If you include an environment name in the command, the EB CLI doesn't prompt you to make any selections or create a service role.

If you run the command without an environment name argument, it runs in an interactive flow, and prompts you to enter or select values for some settings. In this interactive flow, in case you are deploying a sample application, the EB CLI also asks you if you want to download this sample application to your local project directory. By downloading it, you can use the EB CLI with the new environment later to run operations that require the application's code, such as [**eb deploy**](eb3-deploy.md).

Some interactive flow prompts are displayed only under certain conditions. For example, if you choose to use an Application Load Balancer, and your account has at least one sharable Application Load Balancer, Elastic Beanstalk displays a prompt that asks if you want to use a shared load balancer. If no sharable Application Load Balancer exists in your account, this prompt isn't displayed.

## Options


None of these options are required. If you run **eb create** without any options, the EB CLI prompts you to enter or select a value for each setting.


****  

|  Name  |  Description  | 
| --- | --- | 
|  `-d` or `--branch_default`  |  Set the environment as the default environment for the current repository.  | 
|  `--cfg` *config-name*  |  [Use platform settings from a saved configuration](environment-configuration-methods-during.md#configuration-options-during-ebcli-savedconfig) in `.elasticbeanstalk/saved_configs/` or your Amazon S3 bucket. Specify the name of the file only, without the `.cfg.yml` extension.  | 
|  `-c` *subdomain-name* or `--cname` *subdomain-name*  |  The subdomain name to prefix the CNAME DNS entry that routes to your website. Type: String Default: The environment name  | 
|  `-db` or `--database`  |  Attaches a database to the environment. If you run **eb create** with the `--database` option, but without the `--database.username` and `--database.password` options, EB CLI prompts you for the database master user name and password.  | 
|  `-db.engine` *engine* or `--database.engine` *engine*  |  The database engine type. If you run **eb create** with this option, then EB CLI launches the environment with a database attached. This is the case even if you didn't run the command with the `--database` option. Type: String Valid values: `mysql`, `oracle-se1`, `postgres`, `sqlserver-ex`, `sqlserver-web`, `sqlserver-se`  | 
|  `-db.i` *instance\$1type* or `--database.instance` *instance\$1type*  |  The type of Amazon EC2 instance to use for the database. If you run **eb create** with this option, then EB CLI launches the environment with a database attached. This is the case even if you didn't run the command with the `--database` option. Type: String Valid values: Amazon RDS supports a standard set of DB instances. To select an appropriate DB instance for your DB engine, you must take into account some specific considerations. For more information, see [DB instance classes](https://docs.amazonaws.cn/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) in the *Amazon RDS User Guide*.  | 
|  `-db.pass` *password* or `--database.password` *password*  |  The password for the database. If you run **eb create** with this option, then EB CLI launches the environment with a database attached. This is the case even if you didn't run the command with the `--database` option.  | 
|  `-db.size` *number\$1of\$1gigabytes* or `--database.size` *number\$1of\$1gigabytes*  |  The number of gigabytes (GB) to allocate for database storage. If you run **eb create** with this option, then EB CLI launches the environment with a database attached. This is the case even if you didn't run the command with the `--database` option. Type: Number Valid values: [\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/eb3-create.html)  | 
|  `-db.user` *username* or `--database.username` *username*  |  The user name for the database. If you run **eb create** with this option, then EB CLI launches the environment with a database attached even if you didn't run the command with the `--database` option. If you run **eb create** with the `--database` option, but without the `--database.username` and `--database.password` options, then EB CLI prompts you for the master database user name and password.  | 
|  `-db.version` *version* or `--database.version` *version*  |  Used to specify the database engine version. If this flag is present, the environment will launch with a database with the specified version number, even if the `--database` flag isn't present.  | 
|  `--elb-type` *type*  |  The [load balancer type](using-features.managing.elb.md). Type: String Valid values: `classic`, `application`, `network` Default: `application`  | 
|  `-es` or `--enable-spot`  |  Enable Spot Instance requests for your environment. For more information, see [Auto Scaling group](using-features.managing.as.md). Related options: [\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/eb3-create.html)  | 
| --env-group-suffix groupname | The group name to append to the environment name. Only for use with [Compose Environments](ebcli-compose.md). | 
|  `--envvars`  |  [Environment properties](environments-cfg-softwaresettings.md) in a comma-separated list with the format *name*=*value*. See [Configuring environment properties (environment variables)](environments-cfg-softwaresettings.md#environments-cfg-softwaresettings-console) for limits.  | 
|  `-ip` *profile\$1name* or `--instance_profile` *profile\$1name*  |  The instance profile with the IAM role with the temporary security credentials that your application needs to access Amazon resources.  | 
|  `-it` or `-﻿-﻿instance-types type1[,type2 ...]`  |  A comma-separated list of Amazon EC2 instance types that you want your environment to use. If you don't specify this option, Elastic Beanstalk provides default instance types. For more information, see [Amazon EC2 instances](using-features.managing.ec2.md) and [Auto Scaling group](using-features.managing.as.md).  The EB CLI only applies this option to Spot Instances. Unless this option is used with the `--enable-spot` option, the EB CLI ignores it. To specify an instance type for an On-Demand Instance, use the `--intance-type` (no "s") option instead.    | 
|  `-i` or `--instance_type`  |  The Amazon EC2 instance type that you want your environment to use. If you don't specify this option, Elastic Beanstalk provides a default instance type. For more information, see [Amazon EC2 instances](using-features.managing.ec2.md).  The EB CLI only applies this option to On-Demand Instances. Don't use this option with the `--enable-spot` option, because the EB CLI ignores it when you do so. To specify instance types for a Spot Instance, use the `--intance-types` (with an "s") option instead.   | 
|  `-k` *key\$1name* or `--keyname` *key\$1name*  |  The name of the Amazon EC2 key pair to use with the Secure Shell (SSH) client to securely log in to the Amazon EC2 instances that are running your Elastic Beanstalk application. If you include this option with the **eb create** command, the value you provide overwrites any key name that you might have specified with **eb init**. Valid values: An existing key name that's registered with Amazon EC2  | 
|  `-im` *number-of-instances* or `--min-instances` *number-of-instances*  |  The minimum number of Amazon EC2 instances that you require your environment to have. Type: Number (integer) Default: `1` Valid values: `1` to `10000`  | 
|  `-ix` *number-of-instances* or `--max-instances` *number-of-instances*  |  The maximum number of Amazon EC2 instances you allow your environment to have. Type: Number (integer) Default: `4` Valid values: `1` to `10000`  | 
|  `--modules` *component-a component-b*  | A list of component environments to create. This is only for use with [Compose Environments](ebcli-compose.md). | 
|  `-sb` or `--on-demand-base-capacity`  |  The minimum number of On-Demand Instances that your Auto Scaling group provisions before considering Spot Instances as your environment scales up. This option can only be specified with the `--enable-spot` option. For more information, see [Auto Scaling group](using-features.managing.as.md). Type: Number (integer) Default: `0` Valid values: `0` to `--max-instances` (when absent: `MaxSize` option in [`aws:autoscaling:asg`](command-options-general.md#command-options-general-autoscalingasg) namespace)  | 
|  `-sp` or `--on-demand-above-base-capacity`  |  The percentage of On-Demand Instances as part of additional capacity that your Auto Scaling group provisions that's more than the number of instances that's specified by the `--on-demand-base-capacity` option. This option can only be specified with the `--enable-spot` option. For more details, see [Auto Scaling group](using-features.managing.as.md). Type: Number (integer) Default: `0` for a single-instance environment; `70` for a load-balanced environment Valid values: `0` to `100`  | 
|  `-p` *platform-version* or `--platform` *platform-version*  |  The [platform version](concepts.platforms.md) to use. You can specify a platform, a platform and version, a platform branch, a solution stack name, or a solution stack ARN. For example: [\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/eb3-create.html) Use [`eb platform list`](eb3-platform.md) to get a list of available configurations. If you specify the `--platform` option, it overrides the value that was provided during `eb init`.  | 
|  `-pr` or `--process`  |  Preprocess and validate the environment manifest and configuration files in the source bundle. Validating configuration files can identify issues prior to deploying the application version to an environment.  | 
|  `-r` *region* or `--region` *region*  |  The Amazon Region where you want to deploy the application. For the list of values you can specify for this option, see [Amazon Elastic Beanstalk Endpoints and Quotas](https://docs.amazonaws.cn/general/latest/gr/elasticbeanstalk.html) in the *Amazon Web Services General Reference*.  | 
|  `--sample`  |  Deploy the sample application to the new environment instead of the code in your repository.  | 
|  `--scale` *number-of-instances*  |  Launch with the specified number of instances  | 
| --service-role servicerole | Assign a non-default service role to the environment.  Don't enter an ARN. Only enter the role name. Elastic Beanstalk prefixes the role name with the correct values to create the resulting ARN internally.  | 
|  `-ls` *load-balancer* or `--shared-lb` *load-balancer*  |  Configure the environment to use a shared load balancer. Provide the name or ARN of a sharable load balancer in your account—an Application Load Balancer that you explicitly created, not one created by another Elastic Beanstalk environment. For more information, see [Shared Application Load Balancer](environments-cfg-alb-shared.md). Parameter examples: [\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/eb3-create.html) You can specify this option only with `--elb-type application`. If you specify that option and don't specify `--shared-lb`, Elastic Beanstalk creates a dedicated load balancer for the environment.  | 
|  `-lp` *port* or `--shared-lb-port` *port*  |  The default listener port of the shared load balancer for this environment. Elastic Beanstalk adds a listener rule that routes all traffic from this listener to the default environment process. For more information, see [Shared Application Load Balancer](environments-cfg-alb-shared.md). Type: Number (integer) Default: `80` Valid values: Any integer that represents a listener port of the shared load balancer.  | 
|  `--single`  |  Create the environment with a single Amazon EC2 instance and without a load balancer.  A single-instance environment isn't production ready. If the instance becomes unstable during deployment, or Elastic Beanstalk terminates and restarts the instance during a configuration update, your application can be unavailable for a period of time. Use single-instance environments for development, testing, or staging. Use load-balanced environments for production.   | 
|  `-sm` or `--spot-max-price`  |  The maximum price per unit hour, in US dollars, that you're willing to pay for a Spot Instance. This option can only be specified with the `--enable-spot` option. For more details, see [Auto Scaling group](using-features.managing.as.md). Type: Number (float) Default: The On-Demand price, for each instance type. The option's value in this case is `null`. Valid values: `0.001` to `20.0` For recommendations about maximum price options for Spot Instances, see [Spot Instance pricing history](https://docs.amazonaws.cn/AWSEC2/latest/UserGuide/using-spot-instances-history.html) in the *Amazon EC2 User Guide*.  | 
|  `-﻿-﻿tags key1=value1[,key2=value2 ...]`  |  Tag the resources in your environment. Tags are specified as a comma-separated list of `key=value` pairs. For more information, see [Tagging environments](using-features.tagging.md).  | 
|  `-t worker` or `--tier worker`  | Create a worker environment. Omit this option to create a web server environment. | 
|  `--timeout` *minutes*  |  Set number of minutes before the command times out.  | 
|  `--version` *version\$1label*  |  Specifies the application version that you want deployed to the environment instead of the application source code in the local project directory. Type: String Valid values: An existing application version label  | 
|  `--vpc`  |  Configure a VPC for your environment. When you include this option, the EB CLI prompts you to enter all required settings prior to launching the environment.  | 
|  `--vpc.dbsubnets subnet1,subnet2`  |  Specifies subnets for database instances in a VPC. Required when `--vpc.id` is specified.  | 
|  `--vpc.ec2subnets subnet1,subnet2`  |  Specifies subnets for Amazon EC2 instances in a VPC. Required when `--vpc.id` is specified.  | 
|  `--vpc.elbpublic`  |  Launches your Elastic Load Balancing load balancer in a public subnet in your VPC. You can't specify this option with the `--tier worker` or `--single` options.  | 
|  `--vpc.elbsubnets subnet1,subnet2`  |  Specifies subnets for the Elastic Load Balancing load balancer in a VPC. You can't specify this option with the `--tier worker` or `--single` options.  | 
|  `--vpc.id ID`  |  Launches your environment in the specified VPC.  | 
|  `--vpc.publicip`  |  Launches your Amazon EC2 instances in a public subnet in your VPC. You can't specify this option with the `--tier worker` option.  | 
|  `--vpc.securitygroups securitygroup1,securitygroup2`  |  Specifies security group IDs. Required when `--vpc.id` is specified.  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


If successful, the command prompts you with questions and then returns the status of the create operation. If there were problems during the launch, you can use the [**eb events**](eb3-events.md) operation to get more details.

If you enabled CodeBuild support in your application, **eb create** displays information from CodeBuild as your code is built. For information about CodeBuild support in Elastic Beanstalk, see [Using the EB CLI with Amazon CodeBuild](eb-cli-codebuild.md).

## Examples


The following example creates an environment in interactive mode.

```
$ eb create
Enter Environment Name
(default is tmp-dev): ENTER
Enter DNS CNAME prefix
(default is tmp-dev): ENTER
Select a load balancer type
1) classic
2) application
3) network
(default is 2): ENTER
Environment details for: tmp-dev
  Application name: tmp
  Region: us-west-2
  Deployed Version: app-141029_145448
  Environment ID: e-um3yfrzq22
  Platform: 64bit Amazon Linux 2014.09 v1.0.9 running PHP 5.5
  Tier: WebServer-Standard-1.0
  CNAME: tmp-dev.elasticbeanstalk.com
  Updated: 2014-10-29 21:54:51.063000+00:00
Printing Status:
...
```

The following example also creates an environment in interactive mode. In this example, your project directory doesn't have application code. The command deploys a sample application and downloads it to your local project directory.

```
$ eb create
Enter Environment Name
(default is tmp-dev): ENTER
Enter DNS CNAME prefix
(default is tmp-dev): ENTER
Select a load balancer type
1) classic
2) application
3) network
(default is 2): ENTER
NOTE: The current directory does not contain any source code. Elastic Beanstalk is launching the sample application instead.
Do you want to download the sample application into the current directory?
(Y/n): ENTER
INFO: Downloading sample application to the current directory.
INFO: Download complete.
Environment details for: tmp-dev
  Application name: tmp
  Region: us-west-2
  Deployed Version: Sample Application
  Environment ID: e-um3yfrzq22
  Platform: 64bit Amazon Linux 2014.09 v1.0.9 running PHP 5.5
  Tier: WebServer-Standard-1.0
  CNAME: tmp-dev.elasticbeanstalk.com
  Updated: 2017-11-08 21:54:51.063000+00:00
Printing Status:
...
```

The following command creates an environment without displaying any prompts.

```
$ eb create dev-env
Creating application version archive "app-160312_014028".
Uploading test/app-160312_014028.zip to S3. This may take a while.
Upload Complete.
Application test has been created.
Environment details for: dev-env
  Application name: test
  Region: us-west-2
  Deployed Version: app-160312_014028
  Environment ID: e-6fgpkjxyyi
  Platform: 64bit Amazon Linux 2015.09 v2.0.8 running PHP 5.6
  Tier: WebServer-Standard
  CNAME: UNKNOWN
  Updated: 2016-03-12 01:40:33.614000+00:00
Printing Status:
...
```

The following command creates an environment in a custom VPC.

```
$ eb create dev-vpc --vpc.id vpc-0ce8dd99 --vpc.elbsubnets subnet-b356d7c6,subnet-02f74b0c --vpc.ec2subnets subnet-0bb7f0cd,subnet-3b6697c1 --vpc.securitygroup sg-70cff265
Creating application version archive "app-160312_014309".
Uploading test/app-160312_014309.zip to S3. This may take a while.
Upload Complete.
Environment details for: dev-vpc
  Application name: test
  Region: us-west-2
  Deployed Version: app-160312_014309
  Environment ID: e-pqkcip3mns
  Platform: 64bit Amazon Linux 2015.09 v2.0.8 running Java 8
  Tier: WebServer-Standard
  CNAME: UNKNOWN
  Updated: 2016-03-12 01:43:14.057000+00:00
Printing Status:
...
```

# **eb deploy**


## Description


Deploys the application source bundle from the initialized project directory to the running application.

If git is installed, EB CLI uses the `git archive` command to create a `.zip` file from the contents of the most recent `git commit` command.

However, when `.ebignore` is present in your project directory, the EB CLI doesn't use git commands and semantics to create your source bundle. This means that EB CLI ignores files specified in `.ebignore`, and includes all other files. In particular, it includes uncommitted source files.

**Note**  
You can configure the EB CLI to deploy an artifact from your build process instead of creating a ZIP file of your project folder. See [Deploying an artifact instead of the project folder](eb-cli3-configuration.md#eb-cli3-artifact) for details.

## Syntax


 **eb deploy** 

 **eb deploy *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `-l` *version\$1label* or `--label` *version\$1label*  |  Specify a label to use for the version that the EB CLI creates. If the label has already been used, the EB CLI redeploys the previous version with that label. Type: String  | 
| --env-group-suffix groupname | Group name to append to the environment name. Only for use with [Compose Environments](ebcli-compose.md). | 
|  `-m` "*version\$1description*" or `--message` "*version\$1description*"  |  The description for the application version, enclosed in double quotation marks. Type: String  | 
|  `--modules` *component-a component-b*  | List of components to update. Only for use with [Compose Environments](ebcli-compose.md). | 
|  `-p` or `--process`  |  Preprocess and validate the environment manifest and configuration files in the source bundle. Validating configuration files can identify issues prior to deploying the application version to an environment.  | 
|  `--source codecommit/repository-name/branch-name`  |  CodeCommit repository and branch.  | 
|  `--staged`  |  Deploy files staged in the git index instead of the HEAD commit.  | 
|  `--timeout` *minutes*  |  The number of minutes before the command times out.  | 
|  `--version` *version\$1label*  |  An existing application version to deploy. Type: String  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


If successful, the command returns the status of the `deploy` operation.

If you enabled CodeBuild support in your application, **eb deploy** displays information from CodeBuild as your code is built. For information about CodeBuild support in Elastic Beanstalk, see [Using the EB CLI with Amazon CodeBuild](eb-cli-codebuild.md).

## Example


The following example deploys the current application.

```
$ eb deploy
2018-07-11 21:05:22    INFO: Environment update is starting.
2018-07-11 21:05:27    INFO: Deploying new version to instance(s).
2018-07-11 21:05:53    INFO: New application version was deployed to running EC2 instances.
2018-07-11 21:05:53    INFO: Environment update completed successfully.
```

# **eb events**


## Description


Returns the most recent events for the environment.

If the root directory contains a `platform.yaml` file specifying a custom platform, this command also returns the most recent events for the builder environment.

## Syntax


 **eb events** 

 **eb events *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `-f` or `--follow`  |  Streams events. To cancel, press CTRL\$1C.  | 

## Output


If successful, the command returns recent events.

## Example


The following example returns the most recent events.

```
$ eb events
2014-10-29 21:55:39     INFO    createEnvironment is starting.
2014-10-29 21:55:40     INFO    Using elasticbeanstalk-us-west-2-111122223333 as Amazon S3 storage bucket for environment data.
2014-10-29 21:55:57     INFO    Created load balancer named: awseb-e-r-AWSEBLoa-NSKUOK5X6Z9J
2014-10-29 21:56:16     INFO    Created security group named: awseb-e-rxgrhjr9bx-stack-AWSEBSecurityGroup-1UUHU5LZ20ZY7
2014-10-29 21:57:18     INFO    Waiting for EC2 instances to launch. This may take a few minutes.
2014-10-29 21:57:18     INFO    Created Auto Scaling group named: awseb-e-rxgrhjr9bx-stack-AWSEBAutoScalingGroup-1TE320ZCJ9RPD
2014-10-29 21:57:22     INFO    Created Auto Scaling group policy named: arn:aws-cn:autoscaling:us-west-2:11122223333:scalingPolicy:2cced9e6-859b-421a-be63-8ab34771155a:autoScalingGroupName/awseb-e-rxgrhjr9bx-stack-AWSEBAutoScalingGroup-1TE320ZCJ9RPD:policyName/awseb-e-rxgrhjr9bx-stack-AWSEBAutoScalingScaleUpPolicy-1I2ZSNVU4APRY
2014-10-29 21:57:22     INFO    Created Auto Scaling group policy named: arn:aws-cn:autoscaling:us-west-2:11122223333:scalingPolicy:1f08b863-bf65-415a-b584-b7fa3a69a0d5:autoScalingGroupName/awseb-e-rxgrhjr9bx-stack-AWSEBAutoScalingGroup-1TE320ZCJ9RPD:policyName/awseb-e-rxgrhjr9bx-stack-AWSEBAutoScalingScaleDownPolicy-1E3G7PZKZPSOG
2014-10-29 21:57:25     INFO    Created CloudWatch alarm named: awseb-e-rxgrhjr9bx-stack-AWSEBCloudwatchAlarmLow-VF5EJ549FZBL
2014-10-29 21:57:25     INFO    Created CloudWatch alarm named: awseb-e-rxgrhjr9bx-stack-AWSEBCloudwatchAlarmHigh-LA9YEW3O6WJO
2014-10-29 21:58:50     INFO    Added EC2 instance 'i-c7ee492d' to Auto ScalingGroup 'awseb-e-rxgrhjr9bx-stack-AWSEBAutoScalingGroup-1TE320ZCJ9RPD'.
2014-10-29 21:58:53     INFO    Successfully launched environment: tmp-dev
2014-10-29 21:59:14     INFO    Environment health has been set to GREEN
2014-10-29 21:59:43     INFO    Adding instance 'i-c7ee492d' to your environment.
```

# **eb health**


## Description


Returns the most recent health for the environment.

If the root directory contains a `platform.yaml` file specifying a custom platform, this command also returns the most recent health for the builder environment.

## Syntax


 **eb health** 

 **eb health *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `-r` or `--refresh`  |  Show health information interactively and update every 10 seconds as new information is reported.  | 
| --mono | Don't display color in output. | 

## Output


If successful, the command returns recent health.

## Example


The following example returns the most recent health information for a Linux environment.

```
~/project $ eb health
 elasticBeanstalkExa-env                                  Ok                       2015-07-08 23:13:20
WebServer                                                                              Ruby 2.1 (Puma)
  total      ok    warning  degraded  severe    info   pending  unknown
    5        5        0        0        0        0        0        0

  instance-id   status     cause                                                                                                health
    Overall     Ok
  i-d581497d    Ok
  i-d481497c    Ok
  i-136e00c0    Ok
  i-126e00c1    Ok
  i-8b2cf575    Ok

  instance-id   r/sec    %2xx   %3xx   %4xx   %5xx      p99      p90      p75     p50     p10                                 requests
    Overall     671.8   100.0    0.0    0.0    0.0    0.003    0.002    0.001   0.001   0.000
  i-d581497d    143.0    1430      0      0      0    0.003    0.002    0.001   0.001   0.000
  i-d481497c    128.8    1288      0      0      0    0.003    0.002    0.001   0.001   0.000
  i-136e00c0    125.4    1254      0      0      0    0.004    0.002    0.001   0.001   0.000
  i-126e00c1    133.4    1334      0      0      0    0.003    0.002    0.001   0.001   0.000
  i-8b2cf575    141.2    1412      0      0      0    0.003    0.002    0.001   0.001   0.000

  instance-id   type       az   running     load 1  load 5      user%  nice%  system%  idle%   iowait%                             cpu
  i-d581497d    t2.micro   1a   12 mins        0.0    0.04        6.2    0.0      1.0   92.5       0.1
  i-d481497c    t2.micro   1a   12 mins       0.01    0.09        5.9    0.0      1.6   92.4       0.1
  i-136e00c0    t2.micro   1b   12 mins       0.15    0.07        5.5    0.0      0.9   93.2       0.0
  i-126e00c1    t2.micro   1b   12 mins       0.17    0.14        5.7    0.0      1.4   92.7       0.1
  i-8b2cf575    t2.micro   1c   1 hour        0.19    0.08        6.5    0.0      1.2   92.1       0.1
  
  instance-id   status     id   version              ago                                                                   deployments
  i-d581497d    Deployed   1    Sample Application   12 mins
  i-d481497c    Deployed   1    Sample Application   12 mins
  i-136e00c0    Deployed   1    Sample Application   12 mins
  i-126e00c1    Deployed   1    Sample Application   12 mins
  i-8b2cf575    Deployed   1    Sample Application   1 hour
```

# **eb init**


## Description


Sets default values for Elastic Beanstalk applications created with EB CLI by prompting you with a series of questions.

**Note**  
The values you set with **eb init** apply to the current directory and repository on the current computer.  
The command creates an Elastic Beanstalk application in your account. To create an Elastic Beanstalk environment, run **[eb create](eb3-create.md)** after running **eb init**.

## Syntax


 **eb init** 

 **eb init** *application-name* 

## Options


If you run **eb init** without specifying the `--platform` option, the EB CLI prompts you to enter a value for each setting.

**Note**  
To use **eb init** to create a new key pair, you must have `ssh-keygen` installed on your local machine and available from the command line.


****  

|  Name  |  Description  |  | 
| --- | --- | --- | 
|  `-i` `--interactive`  |  Forces EB CLI to prompt you to provide a value for every **eb init** command option.  The `init` command prompts you to provide values for **eb init** command options that do not have a (default) value. After the first time you run the **eb init** command in a directory, EB CLI might not prompt you about any command options. Therefore, use the `--interactive` option when you want to change a setting that you previously set.   |  | 
|  `-k` *keyname* `--keyname` *keyname*  |  The name of the Amazon EC2 key pair to use with the Secure Shell (SSH) client to securely log in to the Amazon EC2 instances running your Elastic Beanstalk application.  |  | 
|  `--modules folder-1 folder-2`  |  List of child directories to initialize. Only for use with [Compose Environments](ebcli-compose.md).  |  | 
|  `-p` *platform-version*  `--platform` *platform-version*  |  The [platform version](concepts.platforms.md) to use. You can specify a platform, a platform and version, a platform branch, a solution stack name, or a solution stack ARN. For example: [\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/eb3-init.html) Use [`eb platform list`](eb3-platform.md) to get a list of available configurations. Specify the `--platform` option to skip interactive configuration.  When you specify this option, then EB CLI does not prompt you for values for any other options. Instead, it assumes default values for each option. You can specify options for anything for which you do not want to use default values.   |  | 
|  `--source codecommit/repository-name/branch-name`  |  CodeCommit repository and branch.  |  | 
|  `-﻿-﻿tags key1=value1[,key2=value2 ...]`  |  Tag your application. Tags are specified as a comma-separated list of `key=value` pairs. For more details, see [Tagging applications](applications-tagging.md).  | 
|  [Common options](eb3-cmd-options.md)  |  |  | 

## CodeBuild support


If you run **eb init** in a folder that contains a [buildspec.yml](https://docs.amazonaws.cn/codebuild/latest/userguide/build-spec-ref.html) file, Elastic Beanstalk parses the file for an **eb\$1codebuild\$1settings** entry with options specific to Elastic Beanstalk. For information about CodeBuild support in Elastic Beanstalk, see [Using the EB CLI with Amazon CodeBuild](eb-cli-codebuild.md).

## Output


If successful, the command guides you through setting up a new Elastic Beanstalk application through a series of prompts.

## Example


The following example request initializes EB CLI and prompts you to enter information about your application. Replace *placeholder* text with your own values.

```
$ eb init -i
Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : Europe (Ireland)
5) eu-central-1 : Europe (Frankfurt)
6) ap-south-1 : Asia Pacific (Mumbai)
7) ap-southeast-1 : Asia Pacific (Singapore)
...
(default is 3): 3

Select an application to use
1) HelloWorldApp
2) NewApp
3) [ Create new Application ]
(default is 3): 3

Enter Application Name
(default is "tmp"):
Application tmp has been created.

It appears you are using PHP. Is this correct?
(y/n): y

Select a platform branch.
1) PHP 7.2 running on 64bit Amazon Linux
2) PHP 7.1 running on 64bit Amazon Linux (Deprecated)
3) PHP 7.0 running on 64bit Amazon Linux (Deprecated)
4) PHP 5.6 running on 64bit Amazon Linux (Deprecated)
5) PHP 5.5 running on 64bit Amazon Linux (Deprecated)
6) PHP 5.4 running on 64bit Amazon Linux (Deprecated)
(default is 1): 1
Do you want to set up SSH for your instances?
(y/n): y

Select a keypair.
1) aws-eb
2) [ Create new KeyPair ]
(default is 2): 1
```

# **eb labs**


## Description


Subcommands of **eb labs** support work-in-progress or experimental functionality. These commands may be removed or reworked in future versions of the EB CLI and are not guaranteed to be forward compatible.

For a list of available subcommands and descriptions, run **eb labs --help**.

# **eb list**


## Description


Lists all environments in the current application or all environments in all applications, as specified by the `--all` option.

If the root directory contains a `platform.yaml` file specifying a custom platform, this command also lists the builder environments.

## Syntax


 **eb list** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `-a` or `--all`  |  Lists all environments from all applications.  | 
|  `-v` or `--verbose`  |  Provides more detailed information about all environments, including instances.  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


If successful, the command returns a list of environment names in which your current environment is marked with an asterisk (\$1).

## Example 1


The following example lists your environments and indicates that tmp-dev is your default environment.

```
$ eb list
* tmp-dev
```

## Example 2


The following example lists your environments with additional details.

```
$ eb list --verbose
Region: us-west-2
Application: tmp
    Environments: 1
        * tmp-dev : ['i-c7ee492d']
```

# **eb local**


## Description


Use **eb local run** to run your application's containers locally in Docker. Check the application's container status with **eb local status**. Open the application in a web browser with **eb local open**. Retrieve the location of the application's logs with **eb local logs**.

**eb local setenv** and **eb local printenv** let you set and view environment variables that are provided to the Docker containers that you run locally with **eb local run**.

You must run all **eb local** commands in the project directory of a Docker application that has been initialized as an EB CLI repository by using **eb init**.

**Note**  
Use **eb local** on a local computer running Linux or macOS. The command doesn't support Windows.  
Before using the command on macOS, install Docker for Mac, and ensure that boot2docker isn't installed (or isn't in the execution path). The **eb local** command tries to use boot2docker if it's present, but doesn't work well with it on macOS.

## Syntax


**eb local run**

**eb local status**

**eb local open**

**eb local logs**

**eb local setenv**

**eb local printenv**

## Options


**eb local run**


****  

|  Name  |  Description  | 
| --- | --- | 
|  `--envvars key1=value1,key2=value2`  |  Sets environment variables that the EB CLI will pass to the local Docker containers. In multicontainer environments, all variables are passed to all containers.  | 
|  `--port hostport`  |  Maps a port on the host to the exposed port on the container. If you don't specify this option, the EB CLI uses the same port on both host and container. This option works only with Docker platform applications. It doesn't apply to the Multicontainer Docker platform.  | 
|  [Common options](eb3-cmd-options.md)  |  | 

**eb local status**

**eb local open**

**eb local logs**

**eb local setenv**

**eb local printenv**

 


****  

|  Name  |  Description  | 
| --- | --- | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


**eb local run**

Status messages from Docker. Remains active as long as application is running. Press **Ctrl\$1C** to stop the application.

**eb local status**

The status of each container used by the application, running or not.

**eb local open**

Opens the application in a web browser and exits.

**eb local logs**

The location of the logs generated in your project directory by applications running locally under **eb local run**.

**eb local setenv**

None

**eb local printenv**

The name and values of environment variables set with **eb local setenv**.

## Examples


**eb local run**

```
~/project$ eb local run
Creating elasticbeanstalk_phpapp_1...
Creating elasticbeanstalk_nginxproxy_1...
Attaching to elasticbeanstalk_phpapp_1, elasticbeanstalk_nginxproxy_1
phpapp_1     | [23-Apr-2015 23:24:25] NOTICE: fpm is running, pid 1
phpapp_1     | [23-Apr-2015 23:24:25] NOTICE: ready to handle connections
```

**eb local status**

View the status of your local containers:

```
~/project$ eb local status
Platform: 64bit Amazon Linux 2014.09 v1.2.1 running Multi-container Docker 1.3.3 (Generic)
Container name: elasticbeanstalk_nginxproxy_1
Container ip: 127.0.0.1
Container running: True
Exposed host port(s): 80
Full local URL(s): 127.0.0.1:80

Container name: elasticbeanstalk_phpapp_1
Container ip: 127.0.0.1
Container running: True
Exposed host port(s): None
Full local URL(s): None
```

**eb local logs**

View the log path for the current project:

```
~/project$ eb local logs
Elastic Beanstalk will write logs locally to /home/user/project/.elasticbeanstalk/logs/local.
Logs were most recently created 3 minutes ago and written to /home/user/project/.elasticbeanstalk/logs/local/150420_234011665784.
```

**eb local setenv**

Set environment variables for use with **eb local run**.

```
~/project$ eb local setenv PARAM1=value
```

Print environment variables set with **eb local setenv**.

```
~/project$ eb local printenv
Environment Variables:
PARAM1=value
```

# **eb logs**


## Description


The **eb logs** command has three distinct purposes: to enable or disable log streaming to CloudWatch Logs, to retrieve instance logs or CloudWatch Logs logs, and to request AI-powered analysis of your environment. With the `--cloudwatch-logs` (`-cw`) option, the command enables or disables log streaming. With the `--analyze` (`-ai`) option, the command requests an AI-powered analysis of your environment's logs, events, and instance health. Without either of these options, it retrieves logs.

When retrieving logs, specify the `--all`, `--zip`, or `--stream` option to retrieve complete logs. If you don't specify any of these options, Elastic Beanstalk retrieves tail logs.

The command processes logs for the specified or default environment. Relevant logs vary by container type. If the root directory contains a `platform.yaml` file specifying a custom platform, this command also processes logs for the builder environment.

For more information, see [Using Elastic Beanstalk with Amazon CloudWatch Logs](AWSHowTo.cloudwatchlogs.md). For more information about AI-powered analysis, see [AI-powered environment analysis](health-ai-analysis.md).

## Syntax


 To enable or disable log streaming to CloudWatch Logs: 

```
eb logs --cloudwatch-logs [enable | disable] [--cloudwatch-log-source instance | environment-health | all] [environment-name]
```

 To retrieve instance logs: 

```
eb logs [-all | --zip | --stream] [--cloudwatch-log-source instance] [--instance instance-id] [--log-group log-group] [environment-name]
```

 To retrieve environment health logs: 

```
eb logs [-all | --zip | --stream] --cloudwatch-log-source environment-health [environment-name]
```

 To request AI-powered analysis: 

```
eb logs --analyze [environment-name]
```

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `-cw [enable \| disable]` or `--cloudwatch-logs [enable \| disable]`  |  Enables or disables log streaming to CloudWatch Logs. If no argument is supplied, log streaming is enabled. If the `--cloudwatch-log-source` (`-cls`) option isn't specified in addition, instance log streaming is enabled or disabled.  | 
|  `-cls instance \| environment-health \| all` or `--cloudwatch-log-source instance \| environment-health \| all`  |  Specifies the source of logs when working with CloudWatch Logs. With the enable or disable form of the command, these are the logs for which to enable or disable CloudWatch Logs streaming. With the retrieval form of the command, these are the logs to retrieve from CloudWatch Logs. Valid values: [\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/eb3-logs.html) Value meanings: [\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/eb3-logs.html)  | 
|  `-a` or `--all`  |  Retrieves complete logs and saves them to the `.elasticbeanstalk/logs` directory.  | 
|  `-z` or `--zip`  |  Retrieves complete logs, compresses them into a `.zip` file, and then saves the file to the `.elasticbeanstalk/logs` directory.  | 
|  `--stream`  |  Streams (continuously outputs) complete logs. With this option, the command keeps running until you interrupt it (press **Ctrl\$1C**).  | 
|  `-i instance-id` or `--instance instance-id`  |  Retrieves logs for the specified instance only.  | 
|  `-g log-group` or `--log-group log-group`  |  Specifies the CloudWatch Logs log group from which to retrieve logs. The option is valid only when instance log streaming to CloudWatch Logs is enabled. If instance log streaming is enabled, and you don't specify the `--log-group` option, the default log group is one of the following: [\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/eb3-logs.html) For information about the log group corresponding to each log file, see [How Elastic Beanstalk sets up CloudWatch Logs](AWSHowTo.cloudwatchlogs.md#AWSHowTo.cloudwatchlogs.loggroups).  | 
|  `-ai` or `--analyze`  |  Requests an AI-powered analysis of your environment's logs, events, and instance health. The analysis uses Amazon Bedrock to identify root causes and recommend solutions for environment health issues. The command sends the request, waits for the analysis to complete, and then displays the results. This option is not compatible with `--instance`, `--all`, `--zip`, `--log-group`, or `--cloudwatch-logs`. For prerequisites and required permissions, see [AI-powered environment analysis](health-ai-analysis.md).  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


By default, displays the logs directly in the terminal. Uses a paging program to display the output. Press **Q** or **q** to exit.

With `--stream`, shows existing logs in the terminal and keeps running. Press **Ctrl\$1C** to exit.

With `--all` and `--zip`, saves the logs to local files and displays the file location.

With `--analyze`, displays the AI-generated analysis directly in the terminal after the analysis completes.

## Examples


The following example enables instance log streaming to CloudWatch Logs.

```
$ eb logs -cw enable
Enabling instance log streaming to CloudWatch for your environment
After the environment is updated you can view your logs by following the link:
https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logs:prefix=/aws/elasticbeanstalk/environment-name/
Printing Status:
2018-07-11 21:05:20    INFO: Environment update is starting.
2018-07-11 21:05:27    INFO: Updating environment environment-name's configuration settings.
2018-07-11 21:06:45    INFO: Successfully deployed new configuration to environment.
```

The following example retrieves instance logs into a `.zip` file.

```
$ eb logs --zip
Retrieving logs...
Logs were saved to /home/workspace/environment/.elasticbeanstalk/logs/150622_173444.zip
```

The following example requests an AI-powered analysis of the environment.

```
$ eb logs --analyze
Analyzing environment...
No critical issues detected. Environment appears healthy.

---
Note: This analysis was generated by AI.
```

# **eb migrate**


## Description


Migrates Internet Information Services (IIS) sites and applications from a Windows server to Elastic Beanstalk. The command packages your applications, preserves their configurations, and deploys them to a new Elastic Beanstalk environment. 

For more information about migrating your IIS sites and applications, see [Migrating IIS applications to Elastic Beanstalk](dotnet-migrating-applications.md).

**Note**  
Before using this command, ensure your system meets these requirements:  
Internet Information Services (IIS) version 7.0 or later
Web Deploy 3.6 or later installed
Administrative privileges on the Windows server
Amazon credentials configured with appropriate permissions
Your source server has outbound internet access to Amazon services.

The following steps summarize the migration process: 

1. Discover IIS sites and their configurations.

1. Package application content and configuration.

1. Create Elastic Beanstalk environment and application.

1. Deploy the application with preserved settings.

The command creates migration artifacts in a structured directory as shown in the following listing:

```
C:\migration_workspace\
└── .\migrations\latest\
    ├── upload_target.zip
    └── upload_target\
        ├── [SiteName].zip                      # One ZIP per default application of IIS site
        ├── [SiteName-ApplicationName].zip      # One ZIP per additional application
        ├── aws-windows-deployment-manifest.json
        └── ebmigrateScripts\
            ├── site_installer.ps1              # Site installation scripts
            ├── permission_handler.ps1          # Permission management
            └── other helper scripts
```

Use **eb migrate cleanup** to manage these artifacts.

## Syntax


**eb migrate *[options]***

**eb migrate explore *[options]***

**eb migrate cleanup *[options]***

When run without arguments, **eb migrate** operates in non-interactive mode. To execute it in the interactive mode, run **eb migrate --interactive**.

The interactive mode command prompts for the following information:
+ Selection of IIS sites to migrate
+ Environment and application names
+ Platform version selection
+ Instance type and other configuration options

## Subcommands


### explore


The **eb migrate explore** subcommand examines your IIS server and lists available sites.

Use this command to display the following information:
+ View all IIS sites on the server
+ With `--verbose`, inspect detailed configuration including:
  + Site bindings and ports
  + Application pools
  + Virtual directories and their physical paths
  + Authentication settings

```
PS C:\migrations_workspace >  eb migrate explore
Default Web Site
Site2
site3
router
```

```
PS C:\migrations_workspace >  eb migrate explore --verbose
1: Default Web Site:
  - Bindings:
    - *:8083:
  - Application '/':
    - Application Pool: DefaultAppPool
    - Enabled Protocols: http
    - Virtual Directories:
      - /:
        - Physical Path: C:\inetpub\wwwroot
        - Logon Method: ClearText
  - Application '/dotnet-6-0':
    - Application Pool: DefaultAppPool
    - Enabled Protocols: http
    - Virtual Directories:
      - /:
        - Physical Path: C:\inetpub\AspNetCoreWebApps\CoreWebApp-6-0
        - Logon Method: ClearText
  - Application '/dotnet-8-0':
    - Application Pool: DefaultAppPool
    - Enabled Protocols: http
    - Virtual Directories:
      - /:
        - Physical Path: C:\inetpub\AspNetCoreWebApps\CoreWebApp-8-0
        - Logon Method: ClearText
2: Site2:
  - Bindings:
    - *:8081:
...
```

### cleanup


The **eb migrate cleanup** subcommand manages migration artifacts with the following actions:
+ Preserving the most recent successful migration in `./migrations/latest`
+ Removing older migration directories
+ Maintaining critical configuration files

```
PS C:\migrations_workspace >   eb migrate cleanup
Are you sure you would like to cleanup older artifacts within `./migrations/`? (y/N):
```

Use `--force` to skip confirmation prompts during cleanup.

```
PS C:\migrations_workspace >   eb migrate cleanup --force
```

## Options


None of these options are required. If you run **eb migrate** without any options, the EB CLI will execute in the non-interactive mode. With **eb migrate --interactive**, the EB CLI prompts you to enter or select a value for required settings.


****  

|  Name  |  Description  | 
| --- | --- | 
|  `-a` *application-name* or `--application-name` *application-name*  |  Name for the new Elastic Beanstalk application. Type: String Default: EBMigratedApp  | 
|  `--archive` *directory-or-zip*  |  The directory or ZIP file containing source code previously generated by **eb migrate --archive-only**. Use this option to deploy a previously created migration package. Example: `--archive .\migrations\latest\upload_target` or `--archive .\migrations\latest\upload_target.zip`  | 
|  `-ao` or `--archive-only`  |  Create only the destination archive directory without deployment. The resulting directory can be manually deployed using **eb migrate** with the `archive` option, or **eb deploy**.  | 
|  `-c` *subdomain-name* or `--cname` *subdomain-name*  |  The subdomain name to prefix the CNAME DNS entry for your migrated application. Type: String Default: The environment name  | 
|  `-cf` or `--copy-firewall-config`  |  Copy source server firewall configuration to the destination for all HTTP ports with active bindings. Creates corresponding security group rules in Amazon.  | 
|  `-es` *snapshot-id* [*snapshot-id* ...] or `--ebs-snapshots` *snapshot-id* [*snapshot-id* ...]  |  Comma-separated list of Amazon EBS snapshot IDs to associate with the environment. Example: `--ebs-snapshots snap-1234567890abcdef0, snap-0987654321fedcba1`  | 
|  `--encrypt-ebs-volumes`  |  Enforce encryption for all new Amazon EBS volumes.  This is an account-wide setting that affects all future Amazon EBS volume creation.   | 
|  `-e` *environment-name* or `--environment-name` *environment-name*  |  Name for the new Elastic Beanstalk environment. Type: String Default: EBMigratedEnv Constraints: Must be between 4 and 40 characters in length. Can only contain letters, numbers, and hyphens. Cannot start or end with a hyphen.  | 
|  `--force`  |  Skip confirmation prompts during operations. When used with **cleanup** subcommand, removes migration artifacts without confirmation.  | 
|  `-ip` *profile-name* or `--instance-profile` *profile-name*  |  Instance Profile to associate with the environment's Amazon EC2 instances. If not specified, creates a default instance profile with permissions to access Elastic Beanstalk resources. For more information, see [Elastic Beanstalk instance profile](concepts-roles-instance.md).   | 
|  `-i` *instance-type* or `--instance-type` *instance-type*  |  The Amazon EC2 instance type for your Elastic Beanstalk environment. Type: String Default: c5.2xlarge For available instance types, see [Amazon EC2 instance types](https://docs.amazonaws.cn/AWSEC2/latest/UserGuide/instance-types.html) in the *Amazon EC2 User Guide*.  | 
|  `-in` or `--interactive`  |  Force interactive mode for the migration process. Prompts for configuration values even when defaults are available.  | 
|  `-k` *key-name* or `--keyname` *key-name*  |  Amazon EC2 key pair to enable RDP access to environment instances. Useful for investigating instance-level issues not visible in logs. Valid values: An existing key pair name registered with Amazon EC2  | 
|  `-p` *platform-version* or `--platform` *platform-version*  |  Elastic Beanstalk platform runtime for the environment. If not specified, automatically detected from host Windows Server version. Example: `"64bit Windows Server 2016 v2.16.2 running IIS 10.0"` For a list of available platform versions, use [eb platform list](eb3-platform.md#eb3-platform-list).  | 
|  `--remote`  |  Indicates to execute the migration in remote mode. This option allows execution from a bastion host, which connects to the target server that contains the application and configurations to be migrated to Elastic Beanstalk. Running from the bastion server, `eb migrate` discovers configurations, stages migration logic on the bastion host, then deploys your application to a new Elastic Beanstalk environment.  This option eliminates the need to install the EB CLI and Python on the Windows server that you need to migrate. You install Python and the EB CLI on a bastion host instead, where you run the **eb migrate** command with the `--remote` option. Use the `--target-ip` option to specify the host with the IIS configurations to migrate. Must be used with `--target-ip`, `--username`, and `--password`.  | 
|  `--target-ip` *ip-address*  |  Public IP address of the remote Windows machine that contains the IIS servers to be migrated. Required when using `--remote`. Can only be specified when using `--remote`.  | 
|  `--username` *username*  |  Username of the user profile to access the remote Windows machine that contains the IIS servers to be migrated. Required when using `--remote`. Can only be specified when using `--remote`.  | 
|  `--password` *password*  |  Password of the user profile to access the remote Windows machine that contains the IIS servers to be migrated. Required when using `--remote`. Can only be specified when using `--remote`.  | 
|  `-sr` *role-name* or `--service-role` *role-name*  |  IAM service role for Elastic Beanstalk to manage related Amazon services. If not specified, creates a default service role with necessary permissions. For more information, see [Elastic Beanstalk service role](concepts-roles-service.md).  Specify only the role name, not the full ARN. Elastic Beanstalk automatically creates the complete ARN.   | 
|  `-s` *site-names* or `--sites` *site-names*  |  Comma-separated list of IIS sites to migrate. If not specified, migrates all available sites on the server. Example: `--sites "Default Web Site,Intranet,API"`  | 
|  `--ssl-certificates` *certificate-arn*[,*certificate-arn* ...]  |  Comma-separated list of ACM SSL certificate ARNs to associate with the Application Load Balancer. Required when migrating sites with HTTPS bindings. Example: `--ssl-certificates arn:aws:acm:region:account:certificate/certificate-id`  | 
|  `-t key1=value1[,key2=value2 ...]` or `-﻿-﻿tags key1=value1[,key2=value2 ...]`  |  Comma-separated list of `key=value` pairs to tag new resources in your environment: Environment, Elastic Beanstalk application, Application version. For more information, see [Tagging environments](using-features.tagging.md).  | 
|  `--verbose`  |  Show detailed information during migration process. When used with **explore** subcommand, displays comprehensive site configuration details.  | 
|  `-vpc` *config-file-or-string* or `--vpc-config` *config-file-or-string*  |  VPC configuration for the environment, specified either as a JSON file path or a JSON string. Configuration must include: <pre>{<br />    "id": "vpc-1234567890abcdef0",<br />    "publicip": "true|false",<br />    "elbscheme": "public|private",<br />    "ec2subnets": ["subnet-a1b2c3d4", "subnet-e5f6g7h8"],<br />    "securitygroups": "sg-123456,sg-789012",<br />    "elbsubnets": ["subnet-a1b2c3d4", "subnet-e5f6g7h8"]<br />}</pre> [\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/eb3-migrate.html)  *The migration will ignore any existing VPC settings from the source environment when you specify the *`--vpc-config` *parameter*. When you use this parameter, the migration will only use the VPC settings specified in the configuration file that you're passing in. Using this parameter overrides the default behavior of discovering the source instance's VPC configuration or using the default VPC.   | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


The command provides status updates throughout the migration process:

1. VPC configuration detection (when running on an EC2 instance)

1. Source bundle generation progress for each site

1. Environment creation status

1. Deployment progress

If successful, displays the new environment's details including:
+ Environment name and ID
+ Application name
+ Region
+ Platform version
+ Environment CNAME

For issues during migration, use the [**eb events**](eb3-events.md) and [**eb health**](eb3-health.md) commands to get detailed information.

## Examples


### Basic Usage


Basic migration in interactive mode:

```
PS C:\migrations_workspace >  eb migrate
Identifying VPC configuration of this EC2 instance (i-0123456789abcdef0):
  id: vpc-1234567890abcdef0
  publicip: true
  elbscheme: public
  ec2subnets: subnet-123,subnet-456,subnet-789
  securitygroups: sg-123,sg-456
  elbsubnets: subnet-123,subnet-456,subnet-789

Using .\migrations\latest to contain artifacts for this migration run.
Generating source bundle for sites, applications, and virtual directories...
  Default Web Site/ -> .\migrations\latest\upload_target\DefaultWebSite.zip

Creating application version
Creating environment

Environment details for: EBMigratedEnv
  Application name: EBMigratedApp
  Region: us-west-2
  Deployed Version: app-230320_153045
  Environment ID: e-abcdef1234
  Platform: 64bit Windows Server 2019 v2.7.0 running IIS 10.0
  Tier: WebServer-Standard-1.0
  CNAME: ebmigratedenv.us-west-2.elasticbeanstalk.com
  Updated: 2023-03-20 15:30:45
```

Migrating specific sites with custom configuration:

```
PS C:\migrations_workspace >  eb migrate `
    --sites "Default Web Site,InternalAPI" `
    --application-name "CorporateApp" `
    --environment-name "Production" `
    --instance-type "c5.xlarge" `
    --tags "Environment=Production,Team=WebOps" `
    --copy-firewall-config
```

Creating migration archive without deployment:

```
PS C:\migrations_workspace >  eb migrate --archive-only
Using .\migrations\latest to contain artifacts for this migration run.
Generating source bundle for sites, applications, and virtual directories...
  Default Web Site/ -> .\migrations\latest\upload_target\DefaultWebSite.zip

Generated destination archive directory at .\migrations\latest\upload_target
You can execute `eb init` and `eb create` from this directory to deploy to EB.
```

### Advanced Configuration Examples


Migration with custom VPC configuration using a JSON file:

```
PS C:\migrations_workspace >  cat vpc-config.json
{
    "id": "vpc-1234567890abcdef0",
    "publicip": "false",
    "elbscheme": "internal",
    "ec2subnets": [
        "subnet-private1",
        "subnet-private2"
    ],
    "securitygroups": [
        "sg-app",
        "sg-database",
        "sg-monitoring"
    ],
    "elbsubnets": [
        "subnet-private1",
        "subnet-private2"
    ]
}

PS C:\migrations_workspace eb migrate `
    --sites "InternalAPI" `
    --vpc-config vpc-config.json `
    --instance-type "r5.xlarge" `
    --tags "Environment=Internal,Security=High"
```

Migrating sites with SSL certificates and host headers:

```
PS C:\migrations_workspace >  eb migrate `
    --sites "SecurePortal" `
    --ssl-certificates "arn:aws:acm:region:account:certificate/cert1,arn:aws:acm:region:account:certificate/cert2" `
    --verbose
INFO: Detected HTTPS bindings:
  - www.example.com:443
  - api.example.com:443

INFO: Configuring Application Load Balancer with SSL certificates
INFO: Creating host-based routing rules:
  - www.example.com -> target group 1
  - api.example.com -> target group 2
```

Migration with EBS snapshot configuration:fo

```
PS C:\migrations_workspace >  eb migrate `
    --sites "Default Web Site" `
    --ebs-snapshots "snap-1234567890abcdef0" "snap-0987654321fedcba1" `
    --encrypt-ebs-volumes
Using .\migrations\latest to contain artifacts for this migration run.
INFO: Enabling EBS encryption for all new volumes in us-west-2
INFO: Configuring environment with specified EBS snapshots
```

### Security Configuration Examples


Handling sites with complex firewall rules:

```
PS C:\migrations_workspace >  eb migrate `
    --sites "Default Web Site,ReportingService" `
    --copy-firewall-config `
    --verbose
INFO: Detected the following Windows Firewall rules:
  - Allow Web Traffic (TCP 80, 443)
  - Allow Reporting Traffic (TCP 8081)
INFO: Creating corresponding security group rules
```

Migration with custom IAM roles:

```
PS C:\migrations_workspace >  eb migrate `
    --sites "SecureApp" `
    --instance-profile "CustomInstanceProfile" `
    --service-role "CustomServiceRole"
```

### Remote Execution Examples


Migrating IIS applications from a remote Windows server:

```
PS C:\migrations_workspace >  eb migrate `
    --remote `
    --target-ip "192.0.2.10" `
    --username "administrator" `
    --password "YourPassword123" `
    --application-name "RemoteApp" `
    --environment-name "RemoteEnv"
INFO: Establishing SSH connection to remote host 192.0.2.10...
INFO: Connection established
INFO: Discovering IIS sites on remote host...
INFO: Found 2 sites: Default Web Site, API
INFO: Extracting site configurations...
INFO: Generating source bundle for sites, applications, and virtual directories...
  Default Web Site/ -> .\migrations\latest\upload_target\DefaultWebSite.zip
  API/ -> .\migrations\latest\upload_target\API.zip

Creating application version
Creating environment

Environment details for: RemoteEnv
  Application name: RemoteAppstage mi
  Region: us-west-2
  Deployed Version: app-230320_153045
  Environment ID: e-abcdef1234
  Platform: 64bit Windows Server 2019 v2.7.0 running IIS 10.0
  Tier: WebServer-Standard-1.0
  CNAME: remoteenv.us-west-2.elasticbeanstalk.com
  Updated: 2023-03-20 15:30:45
```

Remote migration with specific site selection:

```
PS C:\migrations_workspace >  eb migrate `
    --remote `
    --target-ip "192.0.2.10" `
    --username "administrator" `
    --password "YourPassword123" `
    --sites "API" `
    --instance-type "c5.large"
```

# **eb open**


## Description


Opens the public URL of your website in the default browser.

## Syntax


 **eb open** 

 **eb open *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


The command **eb open** does not have output. Instead, it opens the application in a browser window.

# **eb platform**


## Description


This command supports two different workspaces:

[Platform](#eb3-platform-preconfigured)  
Use this workspace to manage custom platforms.

[Environment](#eb3-platform-environment)  
Use this workspace to select a default platform or show information about the current platform.

Elastic Beanstalk provides the shortcut **ebp** for **eb platform**.

**Note**  
Windows PowerShell uses **ebp** as a command alias. If you're running the EB CLI in Windows PowerShell, use the long form of this command — **eb platform**.

## Using eb platform for custom platforms


Lists the versions of the current platform and enables you to manage custom platforms.

### Syntax


**eb platform create [*version*] [*options*]**

**eb platform delete [*version*] [*options*]**

**eb platform events [*version*] [*options*]**

**eb platform init [*platform*] [*options*]**

**eb platform list [*options*]**

**eb platform logs [*version*] [*options*]**

**eb platform status [*version*] [*options*]**

**eb platform use [*platform*] [*options*]**

### Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `create [version] [options]`  | Build a new version of the platform. [Learn more](#eb3-platform-create). | 
|  `delete version [options]`  | Delete a platform version. [Learn more](#eb3-platform-delete). | 
|  `events [version] [options]`  | Display the events from a platform version. [Learn more](#eb3-platform-events). | 
|  `init [platform] [options]`  | Initialize a platform repository. [Learn more](#eb3-platform-init). | 
|  `list [options]`  | List the versions of the current platform. [Learn more](#eb3-platform-list). | 
|  `logs [version] [options]`  | Display logs from the builder environment for a platform version. [Learn more](#eb3-platform-logs). | 
|  `status [version] [options]`  | Display the status of the a platform version. [Learn more](#eb3-platform-status). | 
|  `use [platform] [options]`  | Select a different platform from which new versions are built. [Learn more](#eb3-platform-use). | 
|  [Common options](eb3-cmd-options.md)  |  | 

### Common options


All **eb platform** commands include the following common options.


****  

|  Name  |  Description  | 
| --- | --- | 
|  `-h` OR `--help`  |  Shows a help message and exits.  | 
|  `--debug`  |  Shows additional debugging output.  | 
|  `--quiet`  |  Suppresses all output.  | 
|  `-v` OR `--verbose`  |  Shows additional output.  | 
|  `--profile PROFILE`  |  Uses the specified *PROFILE* from your credentials.  | 
|  `-r REGION` OR `--region REGION`  |  Use the region *REGION*.  | 
|  `--no-verify-ssl`  |  Do not verify Amazon SSL certificates.  | 

### Eb platform create


Builds a new version of the platform and returns the ARN for the new version. If there is no builder environment running in the current region, this command launches one. The *version* and increment options (`-M`, `-m`, and `-p`) are mutually exclusive. 

#### Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  *version*  |  If *version* isn't specified, creates a new version based on the most-recent platform with the patch version (N in n.n.N) incremented.  | 
|  `-M` OR `--major-increment`  | Increments the major version number (the N in N.n.n). | 
|  `-m` OR `--minor-increment`  | Increments the minor version number (the N in n.N.n). | 
|  `-p` OR `--patch-increment`  | Increments the patch version number (the N in n.n.N). | 
|  `-i INSTANCE_TYPE` OR --instance-type *INSTANCE\$1TYPE*  | Use *INSTANCE\$1TYPE* as the instance type, such as **t1.micro**. | 
|  `-ip INSTANCE_PROFILE` OR `--instance-profile INSTANCE_PROFILE`  | Use *INSTANCE\$1PROFILE* as the instance profile when creating AMIs for a custom platform. If the `-ip` option isn't specified, creates the instance profile `aws-elasticbeanstalk-custom-platforme-ec2-role` and uses it for the custom platform. | 
|  `-﻿-﻿tags key1=value1[,key2=value2 ...]`  |  Tags are specified as a comma-separated list of `key=value` pairs.  | 
|  `--timeout` *minutes*  |  Set number of minutes before the command times out.  | 
|  `--vpc.id VPC_ID`  | The ID of the VPC in which Packer builds. | 
|  `--vpc.subnets VPC_SUBNETS`  | The VPC subnets in which Packer builds. | 
|  `--vpc.publicip`  | Associates public IPs to EC2 instances launched. | 

### Eb platform delete


Delete a platform version. The version isn't deleted if an environment is using that version.

#### Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `version`  | The version to delete. This value is required. | 
|  `--cleanup`  |  Remove all platform versions in the `Failed` state.  | 
|  `--all-platforms`  |  If `--cleanup` is specified, remove all platform versions in the `Failed` state for all platforms.  | 
|  `--force`  |  Do not require confirmation when deleting a version.  | 

### Eb platform events


Display the events from a platform version. If *version* is specified, display the events from that version, otherwise display the events from the current version.

#### Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  *version* | The version for which events are displayed. This value is required. | 
|  `-f` OR `--follow`  | Continue to display events as they occur. | 

### Eb platform init


Initialize a platform repository.

#### Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `platform`  | The name of the platform to initialize. This value is required, unless `-i` (interactive mode) is enabled. | 
|  `-i` OR `--interactive`  |  Use interactive mode.  | 
|  `-k KEYNAME` OR `--keyname KEYNAME`  |  The default EC2 key name.  | 

You can run this command in a directory that has been previously initialized, although you cannot change the workspace type if run in a directory that has been previously initialized.

To re-initialize with different options, use the `-i` option.

### Eb platform list


List the versions of the platform associated with a workspace (directory) or a region.

The command returns different results depending on the type of workspace you run it in, as follows:
+ In a platform workspace (a directory initialized by `eb platform init`), the command returns a list of all platform versions of the custom platform defined in the workspace. Add the `--all-platforms` or `--verbose` option to get a list of all platform versions of all custom platforms your account has in the region associated with the workspace.
+ In an application workspace (a directory initialized by `eb init`), the command returns a list of all platform versions, both for platforms managed by Elastic Beanstalk and for your account's custom platforms. The list uses short platform version names, and some platform version variants might be combined. Add the `--verbose` option to get a detailed list with full names and all variants listed separately.
+ In an uninitialized directory, the command only works with the `--region` option. It returns a list of all Elastic Beanstalk-managed platform versions supported in the region. The list uses short platform version names, and some platform version variants might be combined. Add the `--verbose` option to get a detailed list with full names and all variants listed separately.

#### Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `-a` OR `--all-platforms`  |  Valid only in an initialized workspace (a directory initialized by `eb platform init` or `eb init`). Lists the platform versions of all custom platforms associated with your account. | 
|  `-s STATUS` OR `--status STATUS`  |  List only the platforms matching *STATUS*: [\[See the AWS documentation website for more details\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/eb3-platform.html)  | 

### Eb platform logs


Display logs from the builder environment for a platform version.

#### Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `version`  |  The version of the platform for which logs are displayed. If omitted, display logs from the current version.  | 
|  `--stream`  | Stream deployment logs that were set up with CloudWatch. | 

### Eb platform status


Display the status of the a platform version.

#### Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `version`  | The version of the platform for which the status is retrieved. If omitted, display the status of the current version. | 

### Eb platform use


Select a different platform from which new versions are built.

#### Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `platform`  | Specifies *platform* as the active version for this workspace. This value is required. | 

## Using eb platform for environments


Lists supported platforms and enables you to set the default platform and platform version to use when you launch an environment. Use **eb platform list** to view a list of all supported platforms. Use **eb platform select** to change the platform for your project. Use **eb platform show** to view your project's selected platform.

### Syntax


**eb platform list**

**eb platform select**

**eb platform show**

### Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `list`  | List the version of the current platform. | 
|  `select`  | Select the default platform. | 
|  `show`  | Show information about the current platform. | 

### Example 1


The following example lists the names of all configurations for all platforms that Elastic Beanstalk supports.

```
$ eb platform list
docker-1.5.0
glassfish-4.0-java-7-(preconfigured-docker)
glassfish-4.1-java-8-(preconfigured-docker)
go-1.3-(preconfigured-docker)
go-1.4-(preconfigured-docker)
iis-7.5
iis-8
iis-8.5
multi-container-docker-1.3.3-(generic)
node.js
php-5.3
php-5.4
php-5.5
python
python-2.7
python-3.4
python-3.4-(preconfigured-docker)
ruby-1.9.3
ruby-2.0-(passenger-standalone)
ruby-2.0-(puma)
ruby-2.1-(passenger-standalone)
ruby-2.1-(puma)
ruby-2.2-(passenger-standalone)
ruby-2.2-(puma)
tomcat-6
tomcat-7
tomcat-7-java-6
tomcat-7-java-7
tomcat-8-java-8
```

### Example 2


The following example prompts you to choose from a list of platforms and the version that you want to deploy for the specified platform.

```
$ eb platform select
Select a platform.
1) PHP
2) Node.js
3) IIS
4) Tomcat
5) Python
6) Ruby
7) Docker
8) Multi-container Docker
9) GlassFish
10) Go
(default is 1): 5

Select a platform version.
1) Python 2.7
2) Python
3) Python 3.4 (Preconfigured - Docker)
```

### Example 3


The following example shows information about the current default platform.

```
$ eb platform show
Current default platform: Python 2.7
New environments will be running:  64bit Amazon Linux 2014.09 v1.2.0 running Python 2.7

Platform info for environment "tmp-dev":
Current: 64bit Amazon Linux 2014.09 v1.2.0 running Python
Latest:  64bit Amazon Linux 2014.09 v1.2.0 running Python
```

# **eb printenv**


## Description


Prints all the environment properties in the command window.

## Syntax


 **eb printenv** 

 **eb printenv *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


If successful, the command returns the status of the `printenv` operation.

## Example


The following example prints environment properties for the specified environment.

```
$ eb printenv
Environment Variables:
     PARAM1 = Value1
```

# **eb restore**


## Description


Rebuilds a terminated environment, creating a new environment with the same name, ID, and configuration. The environment name, domain name, and application version must be available for use in order for the rebuild to succeed.

## Syntax


 **eb restore** 

 **eb restore *environment\$1id*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


The EB CLI displays a list of terminated environments that are available to restore.

## Example


```
$ eb restore
Select a terminated environment to restore

  #   Name          ID             Application Version      Date Terminated        Ago

  3   gamma         e-s7mimej8e9   app-77e3-161213_211138   2016/12/14 20:32 PST   13 mins
  2   beta          e-sj28uu2wia   app-77e3-161213_211125   2016/12/14 20:32 PST   13 mins
  1   alpha         e-gia8mphu6q   app-77e3-161213_211109   2016/12/14 16:21 PST   4 hours

 (Commands: Quit, Restore, ▼ ▲)

Selected environment alpha
Application:    scorekeep
Description:    Environment created from the EB CLI using "eb create"
CNAME:          alpha.h23tbtbm92.us-west-2.elasticbeanstalk.com
Version:        app-77e3-161213_211109
Platform:       64bit Amazon Linux 2016.03 v2.1.6 running Java 8
Terminated:     2016/12/14 16:21 PST
Restore this environment? [y/n]: y

2018-07-11 21:04:20    INFO: restoreEnvironment is starting.
2018-07-11 21:04:39    INFO: Created security group named: sg-e2443f72
...
```

# **eb scale**


## Description


Scales the environment to always run on a specified number of instances, setting both the minimum and maximum number of instances to the specified number.

## Syntax


 **eb scale *number-of-instances*** 

 **eb scale *number-of-instances* *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  --timeout  |  The number of minutes before the command times out.  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


If successful, the command updates the number of minimum and maximum instances to run to the specified number.

## Example


The following example sets the number of instances to 2.

```
$ eb scale 2
2018-07-11 21:05:22    INFO: Environment update is starting.
2018-07-11 21:05:27    INFO: Updating environment tmp-dev's configuration settings.
2018-07-11 21:08:53    INFO: Added EC2 instance 'i-5fce3d53' to Auto Scaling Group 'awseb-e-2cpfjbra9a-stack-AWSEBAutoScalingGroup-7AXY7U13ZQ6E'.
2018-07-11 21:08:58    INFO: Successfully deployed new configuration to environment.
2018-07-11 21:08:59    INFO: Environment update completed successfully.
```

# **eb setenv**


## Description


Sets [environment properties](environments-cfg-softwaresettings.md) for the default environment.

## Syntax


**eb setenv *key*=*value*** 

You can include as many properties as you want, but the total size of all properties cannot exceed 4096 bytes. You can delete a variable by leaving the value blank. See [Configuring environment properties (environment variables)](environments-cfg-softwaresettings.md#environments-cfg-softwaresettings-console) for limits.

**Note**  
If the `value` contains a [special character](http://tldp.org/LDP/abs/html/special-chars.html), you must escape that character by preceding it with a `\` character.

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  --timeout  |  The number of minutes before the command times out.  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


If successful, the command displays that the environment update succeeded.

## Example


The following example sets the environment variable ExampleVar.

```
$ eb setenv ExampleVar=ExampleValue
2018-07-11 21:05:25    INFO: Environment update is starting.
2018-07-11 21:05:29    INFO: Updating environment tmp-dev's configuration settings.
2018-07-11 21:06:50    INFO: Successfully deployed new configuration to environment.
2018-07-11 21:06:51    INFO: Environment update completed successfully.
```

The following command sets multiple environment properties. It adds the environment property named `foo` and sets its value to `bar`, changes the value of the `JDBC_CONNECTION_STRING` property, and deletes the `PARAM4` and `PARAM5` properties.

```
$ eb setenv foo=bar JDBC_CONNECTION_STRING=hello PARAM4= PARAM5=
```

# **eb ssh**


## Description


**Note**  
This command does not work with environments running Windows Server instances.

Connect to a Linux Amazon EC2 instance in your environment using Secure Shell (SSH). If an environment has multiple running instances, EB CLI prompts you to specify which instance you want to connect to. To use this command, SSH must be installed on your local machine and available from the command line. Private key files must be located in a folder named `.ssh` under your user directory, and the EC2 instances in your environment must have public IP addresses.

If the root directory contains a `platform.yaml` file specifying a custom platform, this command also connects to instances in the custom environment.

 

**SSH keys**  
If you have not previously configured SSH, you can use the EB CLI to create a key when running **eb init**. If you have already run **eb init**, run it again with the `--interactive` option and select **Yes** and **Create New Keypair** when prompted to set up SSH. Keys created during this process will be stored in the proper folder by the EB CLI.

This command temporarily opens port 22 in your environment's security group for incoming traffic from 0.0.0.0/0 (all IP addresses) if no rules for port 22 are already in place. If you have configured your environment's security group to open port 22 to a restricted CIDR range for increased security, the EB CLI will respect that setting and forgo any changes to the security group. To override this behavior and force the EB CLI to open port 22 to all incoming traffic, use the `--force` option.

See [EC2 security groups](using-features.managing.ec2.console.md#using-features.managing.ec2.securitygroups) for information on configuring your environment's security group.

## Syntax


 **eb ssh** 

 **eb ssh *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `-i` or `--instance`  |  Specifies the instance ID of the instance to which you connect. We recommend that you use this option.  | 
|  `-n` or `--number`  |  Specify the instance to connect to by number.  | 
|  `-o` or `--keep_open`  |  Leave port 22 open on the security group after the SSH session ends.  | 
|  `--command`  |  Execute a shell command on the specified instance instead of starting an SSH session.  | 
|  `--custom`  |  Specify an SSH command to use instead of 'ssh -i keyfile'. Do not include the remote user and hostname.  | 
|  `--setup`  |  Change the key pair assigned to the environment's instances (requires instances to be replaced).  | 
|  `--force`  |  Open port 22 to incoming traffic from 0.0.0.0/0 in the environment's security group, even if the security group is already configured for SSH. Use this option if your environment's security group is configured to open port 22 to a restricted CIDR range that does not include the IP address that you are trying to connect from.  | 
|  `--timeout` *minutes*  |  Set number of minutes before the command times out. Can only be used with the `--setup` argument.  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


If successful, the command opens an SSH connection to the instance.

## Example


The following example connects you to the specified environment.

```
$ eb ssh
Select an instance to ssh into
1) i-96133799
2) i-5931e053
(default is 1): 1
INFO: Attempting to open port 22.
INFO: SSH port 22 open.
The authenticity of host '54.191.45.125 (54.191.45.125)' can't be established.
RSA key fingerprint is ee:69:62:df:90:f7:63:af:52:7c:80:60:1b:3b:51:a9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '54.191.45.125' (RSA) to the list of known hosts.

       __|  __|_  )
       _|  (     /   Amazon Linux AMI
      ___|\___|___|

http://www.amazonaws.cn/amazon-linux-ami/2014.09-release-notes/
No packages needed for security; 1 packages available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-172-31-8-185 ~]$ ls
[ec2-user@ip-172-31-8-185 ~]$ exit
logout
Connection to 54.191.45.125 closed.
INFO: Closed port 22 on ec2 instance security group
```

# **eb status**


## Description


Provides information about the status of the environment.

If the root directory contains a `platform.yaml` file specifying a custom platform, this command also provides information about the builder environment.

## Syntax


 **eb status** 

 **eb status *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `-v` or `--verbose`  |  Provides more information about individual instances, such as their status with the Elastic Load Balancing load balancer.  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


If successful, the command returns the following information about the environment:
+ Environment name
+ Application name
+ Deployed application version
+ Environment ID
+ Platform
+ Environment tier
+ CNAME
+ Time the environment was last updated
+ Status
+ Health

If you use verbose mode, EB CLI also provides you with the number of running Amazon EC2 instances.

## Example


The following example shows the status for the environment tmp-dev.

```
$ eb status
Environment details for: tmp-dev
  Application name: tmp
  Region: us-west-2
  Deployed Version: None
  Environment ID: e-2cpfjbra9a
  Platform: 64bit Amazon Linux 2014.09 v1.0.9 running PHP 5.5
  Tier: WebServer-Standard-1.0
  CNAME: tmp-dev.elasticbeanstalk.com
  Updated: 2014-10-29 21:37:19.050000+00:00
  Status: Launching
  Health: Grey
```

# **eb swap**


## Description


Swaps the environment's CNAME with the CNAME of another environment (for example, to avoid downtime when you update your application version).

**Note**  
If you have more than two environments, you are prompted to select the name of the environment that is currently using your desired CNAME from a list of environments. To suppress this, you can specify the name of the environment to use by including the `-n` option when you run the command.

## Syntax


 **eb swap** 

 **eb swap *environment-name*** 

**Note**  
The *environment-name* is the environment for which you want a different CNAME. If you don't specify *environment-name* as a command line parameter when you run **eb swap**, EB CLI updates the CNAME of the default environment.

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `-n` or `--destination_name`  |  Specifies the name of the environment with which you want to swap CNAMEs. If you run **eb swap** without this option, then EB CLI prompts you to choose from a list of your environments.  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


If successful, the command returns the status of the `swap` operation.

## Examples


The following example swaps the environment tmp-dev with live-env.

```
$ eb swap
Select an environment to swap with.
1) staging-dev
2) live-env
(default is 1): 2
2018-07-11 21:05:25    INFO: swapEnvironmentCNAMEs is starting.
2018-07-11 21:05:26    INFO: Swapping CNAMEs for environments 'tmp-dev' and 'live-env'.
2018-07-11 21:05:30    INFO: 'tmp-dev.elasticbeanstalk.com' now points to 'awseb-e-j-AWSEBLoa-M7U21VXNLWHN-487871449.us-west-2.elb.amazonaws.com.cn'.
2018-07-11 21:05:30    INFO: Completed swapping CNAMEs for environments 'tmp-dev' and 'live-env'.
```

The following example swaps the environment tmp-dev with the environment live-env but does not prompt you to enter or select a value for any settings.

```
$ eb swap tmp-dev --destination_name live-env
2018-07-11 21:18:12    INFO: swapEnvironmentCNAMEs is starting.
2018-07-11 21:18:13    INFO: Swapping CNAMEs for environments 'tmp-dev' and 'live-env'.
2018-07-11 21:18:17    INFO: 'tmp-dev.elasticbeanstalk.com' now points to 'awseb-e-j-AWSEBLoa-M7U21VXNLWHN-487871449.us-west-2.elb.amazonaws.com.cn'.
2018-07-11 21:18:17    INFO: Completed swapping CNAMEs for environments 'tmp-dev' and 'live-env'.
```

# **eb tags**


## Description


Add, delete, update, and list tags of an Elastic Beanstalk resource.

For details about resource tagging in Elastic Beanstalk, see [Tagging Elastic Beanstalk application resources](applications-tagging-resources.md).

## Syntax


**eb tags [*environment-name*] [--resource *ARN*] -l \$1 --list**

**eb tags [*environment-name*] [--resource *ARN*] -a \$1 --add *key1*=*value1*[,*key2*=*value2* ...]**

**eb tags [*environment-name*] [--resource *ARN*] -u \$1 --update *key1*=*value1*[,*key2*=*value2* ...]**

**eb tags [*environment-name*] [--resource *ARN*] -d \$1 --delete *key1*[,*key2* ...]**

You can combine the `--add`, `--update`, and `--delete` subcommand options in a single command. At least one of them is required. You can't combined any of these three subcommand options with `--list`.

Without any additional arguments, all of these commands list or modify tags of the default environment in the current directory's application. With an *environment-name* argument, the commands list or modify tags of that environment. With the `--resource` option, the commands list or modify tags of any Elastic Beanstalk resource – an application, an environment, an application version, a saved configuration, or a custom platform version. Specify the resource by its Amazon Resource Name (ARN).

## Options


None of these options are required. If you run **eb create** without any options, you are prompted to enter or select a value for each setting.


****  

|  Name  |  Description  | 
| --- | --- | 
|  `-l` or `--list`  |  List all tags that are currently applied to the resource.  | 
|  `-﻿a key1=value1[,key2=value2 ...]` or `-﻿-﻿add key1=value1[,key2=value2 ...]`  |  Apply new tags to the resource. Specify tags as a comma-separated list of `key=value` pairs. You can't specify keys of existing tags. Valid values: See [Tagging resources](applications-tagging-resources.md).  | 
|  `-﻿u key1=value1[,key2=value2 ...]` or `-﻿-﻿update key1=value1[,key2=value2 ...]`  |  Update the values of existing resource tags. Specify tags as a comma-separated list of `key=value` pairs. You must specify keys of existing tags. Valid values: See [Tagging resources](applications-tagging-resources.md).  | 
|  `-﻿d key1[,key2 ...]` or `-﻿-﻿delete key1[,key2 ...]`  |  Delete existing resource tags. Specify tags as a comma-separated list of keys. You must specify keys of existing tags. Valid values: See [Tagging resources](applications-tagging-resources.md).  | 
|  `-r` *region* or `--region` *region*  |  The Amazon Web Services Region in which your resource exists. Default: the configured default region. For the list of values you can specify for this option, see [Amazon Elastic Beanstalk Endpoints and Quotas](https://docs.amazonaws.cn/general/latest/gr/elasticbeanstalk.html) in the *Amazon Web Services General Reference*.  | 
|  `-﻿-﻿resource ARN`  |  The ARN of the resource that the command modifies or lists tags for. If not specified, the command refers to the (default or specified) environment in the current directory's application. Valid values: See one of the sub-topic of [Tagging resources](applications-tagging-resources.md) that is specific to the resource you're interested in. These topics show how the resource's ARN is constructed and explain how to get a list of this resource's ARNs that exist for your application or account.  | 

## Output


The `--list` subcommand option displays a list of the resource's tags. The output shows both the tags that Elastic Beanstalk applies by default and your custom tags.

```
$ eb tags --list
Showing tags for environment 'MyApp-env':

Key                                 Value

Name                                MyApp-env
elasticbeanstalk:environment-id     e-63cmxwjaut
elasticbeanstalk:environment-name   MyApp-env
mytag                               tagvalue
tag2                                2nd value
```

The `--add`, `--update`, and `--delete` subcommand options, when successful, don't have any output. You can add the `--verbose` option to see detailed output of the command's activity.

```
$ eb tags --verbose --update "mytag=tag value"
Updated Tags:

Key                                 Value

mytag                               tag value
```

## Examples


The following command successfully adds a tag with the key `tag1` and the value `value1` to the application's default environment, and at the same time deletes the tag `tag2`.

```
$ eb tags --add tag1=value1 --delete tag2
```

The following command successfully adds a tag to a saved configuration within an application.

```
$ eb tags --add tag1=value1 \
      --resource "arn:aws-cn:elasticbeanstalk:us-west-2:my-account-id:configurationtemplate/my-app/my-template"
```

The following command fails because it tries to update a nonexisting tag.

```
$ eb tags --update tag3=newval
ERROR: Tags with the following keys can't be updated because they don't exist:

  tag3
```

The following command fails because it tries to update and delete the same key.

```
$ eb tags --update mytag=newval --delete mytag
ERROR: A tag with the key 'mytag' is specified for both '--delete' and '--update'. Each tag can be either deleted or updated in a single operation.
```

# **eb terminate**


## Description


Terminates the running environment so that you don't incur charges for unused Amazon resources.

Using the `--all` option, deletes the application that the current directory was initialized to using [**eb init**](eb3-init.md). The command terminates all environments in the application. It also terminates the [application versions](applications-versions.md) and [saved configurations](environment-configuration-savedconfig.md) for the application, and then deletes the application.

If the root directory contains a `platform.yaml` file specifying a custom platform, this command terminates the running custom environment.

**Note**  
You can always launch a new environment using the same version later.

If you have data from an environment that you want to preserve, set the database deletion policy to `Retain` before terminating the environment. This keeps the database operational outside of Elastic Beanstalk. After this, any Elastic Beanstalk environments must connect to it as an external database. If you want to back up the data without keeping the database operational, set the deletion policy to take a snapshot of the database before terminating the environment. For more information, see [Database lifecycle](using-features.managing.db.md#environments-cfg-rds-lifecycle) in the *Configuring environments* chapter of this guide.

**Important**  
If you terminate an environment, you must also delete any CNAME mappings that you created, as other customers can reuse an available hostname. Be sure to delete DNS records that point to your terminated environment to prevent a *dangling DNS entry*. A dangling DNS entry can expose internet traffic destined for your domain to security vulnerabilities. It can also present other risks.  
For more information, see [Protection from dangling delegation records in Route 53](https://docs.amazonaws.cn/Route53/latest/DeveloperGuide/protection-from-dangling-dns.html) in the *Amazon Route 53 Developer Guide*. You can also learn more about dangling DNS entries in [Enhanced Domain Protections for Amazon CloudFront Requests](https://amazonaws-china.com/blogs/security/enhanced-domain-protections-for-amazon-cloudfront-requests/) in the *Amazon Security Blog*.

## Syntax


 **eb terminate** 

 **eb terminate *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `--all`  |  Terminates all environments in the application, the application's [application versions](applications-versions.md), and its [saved configurations](environment-configuration-savedconfig.md), and then deletes the application.  | 
|  `--force`  |  Terminates the environment without prompting for confirmation.  | 
|  `--ignore-links`  |  Terminates the environment even if there are dependent environments with links to it. See [Compose Environments](ebcli-compose.md).  | 
|  `--timeout`  |  The number of minutes before the command times out.  | 

## Output


If successful, the command returns the status of the `terminate` operation.

## Example


The following example request terminates the environment tmp-dev.

```
$ eb terminate
The environment "tmp-dev" and all associated instances will be terminated.
To confirm, type the environment name: tmp-dev
2018-07-11 21:05:25    INFO: terminateEnvironment is starting.
2018-07-11 21:05:40    INFO: Deleted CloudWatch alarm named: awseb-e-2cpfjbra9a-stack-AWSEBCloudwatchAlarmHigh-16V08YOF2KQ7U
2018-07-11 21:05:41    INFO: Deleted CloudWatch alarm named: awseb-e-2cpfjbra9a-stack-AWSEBCloudwatchAlarmLow-6ZAWH9F20P7C
2018-07-11 21:06:42    INFO: Deleted Auto Scaling group policy named: arn:aws-cn:autoscaling:us-west-2:11122223333:scalingPolicy:5d7d3e6b-d59b-47c5-b102-3e11fe3047be:autoScalingGroupName/awseb-e-2cpfjbra9a-stack-AWSEBAutoScalingGroup-7AXY7U13ZQ6E:policyName/awseb-e-2cpfjbra9a-stack-AWSEBAutoSca
lingScaleUpPolicy-1876U27JEC34J
2018-07-11 21:06:43    INFO: Deleted Auto Scaling group policy named: arn:aws-cn:autoscaling:us-west-2:11122223333:scalingPolicy:29c6e7c7-7ac8-46fc-91f5-cfabb65b985b:autoScalingGroupName/awseb-e-2cpfjbra9a-stack-AWSEBAutoScalingGroup-7AXY7U13ZQ6E:policyName/awseb-e-2cpfjbra9a-stack-AWSEBAutoSca
lingScaleDownPolicy-SL4LHODMOMU
2018-07-11 21:06:48    INFO: Waiting for EC2 instances to terminate. This may take a few minutes.
2018-07-11 21:08:55    INFO: Deleted Auto Scaling group named: awseb-e-2cpfjbra9a-stack-AWSEBAutoScalingGroup-7AXY7U13ZQ6E
2018-07-11 21:09:10    INFO: Deleted security group named: awseb-e-2cpfjbra9a-stack-AWSEBSecurityGroup-XT4YYGFL7I99
2018-07-11 21:09:40    INFO: Deleted load balancer named: awseb-e-2-AWSEBLoa-AK6RRYFQVV3S
2018-07-11 21:09:42    INFO: Deleting SNS topic for environment tmp-dev.
2018-07-11 21:09:52    INFO: terminateEnvironment completed successfully.
```

# **eb upgrade**


## Description


Upgrades the platform of your environment to the most recent version of the platform on which it is currently running.

If the root directory contains a `platform.yaml` file specifying a custom platform, this command upgrades the environment to the most recent version of the custom platform on which it is currently running.

## Syntax


 **eb upgrade** 

 **eb upgrade *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `--force`  |  Upgrades without requiring you to confirm the environment name before starting the upgrade process.  | 
|  `--noroll`  |  Updates all instances without using rolling updates to keep some instances in service during the upgrade.  | 
|  [Common options](eb3-cmd-options.md)  |  | 

## Output


The command shows an overview of the change and prompts you to confirm the upgrade by typing the environment name. If successful, your environment is updated and then launched with the most recent version of the platform.

## Example


The following example upgrades the current platform version of the specified environment to the most recently available platform version.

```
$ eb upgrade
Current platform: 64bit Amazon Linux 2014.09 v1.0.9 running Python 2.7
Latest platform:  64bit Amazon Linux 2014.09 v1.2.0 running Python 2.7

WARNING: This operation replaces your instances with minimal or zero downtime. You may cancel the upgrade after it has started by typing "eb abort".
You can also change your platform version by typing "eb clone" and then "eb swap".

To continue, type the environment name:
```

# **eb use**


## Description


Sets the specified environment as the default environment.

When using Git, **eb use** sets the default environment for the current branch. Run this command once in each branch that you want to deploy to Elastic Beanstalk.

## Syntax


 **eb use *environment-name*** 

## Options



****  

|  Name  |  Description  | 
| --- | --- | 
|  `--source codecommit/repository-name/branch-name`  |  CodeCommit repository and branch.  | 
|  `-r region` `--region region`  |  Change the region in which you create environments.  | 
|  [Common options](eb3-cmd-options.md)  |  | 