AWS Elastic Beanstalk
Developer Guide
AWS services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon AWS.

Operations

Note

This tool, the Elastic Beanstalk API CLI, and its documentation have been replaced with the AWS CLI. See the AWS CLI User Guide to get started with the AWS CLI. Also try the EB CLI for a simplified, higher-level command line experience.

elastic-beanstalk-check-dns-availability

Description

Checks if the specified CNAME is available.

Syntax

elastic-beanstalk-check-dns-availability -c [CNAMEPrefix]

Options

Name Description Required

-c

--cname-prefix CNAMEPrefix

The name of the CNAME to check.

Type: String

Default: None

Yes

Output

The command returns a table with the following information:

  • Available—Shows true if the CNAME is available; otherwise, shows false.

  • FullyQualifiedCNAME—Shows the fully qualified CNAME if it is available; otherwise shows N/A.

Examples

Checking to Availability of a CNAME

This example shows how to check to see if the CNAME prefix "myapp23" is available.

PROMPT> elastic-beanstalk-check-dns-availability -c myapp23

elastic-beanstalk-create-application

Description

Creates an application that has one configuration template named default and no application versions.

Note

The default configuration template is for a 32-bit version of the Amazon Linux operating system running the Tomcat 6 application container.

Syntax

elastic-beanstalk-create-application -a [name] -d [desc]

Options

Name Description Required

-a

--application-name name

The name of the application.

Constraint: This name must be unique within your account. If the specified name already exists, the action returns an InvalidParameterValue error.

Type: String

Default: None

Yes

-d

--description desc

The description of the application.

Type: String

Default: None

No

Output

The command returns a table with the following information:

  • ApplicationName—The name of the application. If no application is found with this name, and AutoCreateApplication is false, Elastic Beanstalk returns an InvalidParameterValue error.

  • ConfigurationTemplates—A list of the configuration templates used to create the application.

  • DateCreated—The date the application was created.

  • DateUpdated—The date the application was last updated.

  • Description—The description of the application.

  • Versions—The versions of the application.

Examples

Creating an Application

This example shows how to create an application.

PROMPT> elastic-beanstalk-create-application -a MySampleApp -d "My description"

elastic-beanstalk-create-application-version

Description

Creates an application version for the specified application.

Note

Once you create an application version with a specified Amazon S3 bucket and key location, you cannot change that Amazon S3 location. If you change the Amazon S3 location, you receive an exception when you attempt to launch an environment from the application version.

Syntax

elastic-beanstalk-create-application-version -a [name] -l [label] -c -d [desc] -s [location]

Options

Name Description Required

-a

--application-name name

The name of the application. If no application is found with this name, and AutoCreateApplication is false, Elastic Beanstalk returns an InvalidParameterValue error.

Type: String

Default: None

Length Constraints: Minimum value of 1. Maximum value of 100.

Yes

-c

--auto-create

Determines how the system behaves if the specified application for this version does not already exist:

  • true: Automatically creates the specified application for this release if it does not already exist.

  • false: Throws an InvalidParameterValue if the specified application for this release does not already exist.

Type: Boolean

Valid Values: true | false

Default: false

No

-d

--description desc

The description of the version.

Type: String

Default: None

Length Constraints: Minimum value of 0. Maximum value of 200.

No

-l

--version-label label

A label identifying this version.

Type: String

Default: None

Constraint: Must be unique per application. If an application version already exists with this label for the specified application, Elastic Beanstalk returns an InvalidParameterValue error.

Length Constraints: Minimum value of 1. Maximum value of 100.

Yes

-s

--source-location location

The name of the Amazon S3 bucket and key that identify the location of the source bundle for this version, in the format bucketname/key.

If data found at the Amazon S3 location exceeds the maximum allowed source bundle size, Elastic Beanstalk returns an InvalidParameterCombination error.

Type: String

Default: If not specified, Elastic Beanstalk uses a sample application. If only partially specified (for example, a bucket is provided but not the key) or if no data is found at the Amazon S3 location, Elastic Beanstalk returns an InvalidParameterCombination error.

No

Output

The command returns a table with the following information:

  • ApplicationName—The name of the application.

  • DateCreated—The date the application was created.

  • DateUpdated—The date the application was last updated.

  • Description—The description of the application.

  • SourceBundle—The location where the source bundle is located for this version.

  • VersionLabel—A label uniquely identifying the version for the associated application.

Examples

Creating a Version from a Source Location

This example shows create a version from a source location.

PROMPT> elastic-beanstalk-create-application-version -a MySampleApp -d "My version" -l "TestVersion 1" -s amazonaws.com.cn/sample.war

elastic-beanstalk-create-configuration-template

Description

Creates a configuration template. Templates are associated with a specific application and are used to deploy different versions of the application with the same configuration settings.

Syntax

elastic-beanstalk-create-configuration-template -a [name] -t [name] -E [id] -d [desc] -s [stack] -f [filename] -A [name] -T [name]

Options

Name Description Required

-a

--application-name name

The name of the application to associate with this configuration template. If no application is found with this name, Elastic Beanstalk returns an InvalidParameterValue error.

Type: String

Default: None

Yes

-t

--template-name name

The name of the configuration template. If a configuration template already exists with this name, Elastic Beanstalk returns an InvalidParameterValue error.

Type: String

Default: None

Constraint: Must be unique for this application.

Length Constraints: Minimum value of 1. Maximum value of 100.

Yes

-E

--environment-id id

The environment ID of the configuration template.

Type: String

Default: None

No

-d

--description desc

The description of the configuration.

Type: String

Default: None

No

-s

--solution-stack stack

The name of the solution stack used by this configuration. The solution stack specifies the operating system, architecture, and application server for a configuration template. It determines the set of configuration options as well as the possible and default values.

Use elastic-beanstalk-list-available-solution-stacks to obtain a list of available solution stacks.

A solution stack name or a source configuration parameter must be specified; otherwise, Elastic Beanstalk returns an InvalidParameterValue error.

If a solution stack name is not specified and the source configuration parameter is specified, Elastic Beanstalk uses the same solution stack as the source configuration template.

Type: String

Length Constraints: Minimum value of 0. Maximum value of 100.

No

-f

--options-file filename

The name of a JSON file that contains a set of key-value pairs defining configuration options for the configuration template. The new values override the values obtained from the solution stack or the source configuration template.

Type: String

No

-A

--source-application-name name

The name of the application to use as the source for this configuration template.

Type: String

Default: None

No

-T

--source-template-name name

The name of the template to use as the source for this configuration template.

Type: String

Default: None

No

Output

The command returns a table with the following information:

  • ApplicationName—The name of the application associated with the configuration set.

  • DateCreated—The date (in UTC time) when this configuration set was created.

  • DateUpdated—The date (in UTC time) when this configuration set was last modified.

  • DeploymentStatus—If this configuration set is associated with an environment, the deployment status parameter indicates the deployment status of this configuration set:

    • null: This configuration is not associated with a running environment.

    • pending: This is a draft configuration that is not deployed to the associated environment but is in the process of deploying.

    • deployed: This is the configuration that is currently deployed to the associated running environment.

    • failed: This is a draft configuration that failed to successfully deploy.

  • Description—The description of the configuration set.

  • EnvironmentName—If not null, the name of the environment for this configuration set.

  • OptionSettings—A list of configuration options and their values in this configuration set.

  • SolutionStackName—The name of the solution stack this configuration set uses.

  • TemplateNamel—If not null, the name of the configuration template for this configuration set.

Examples

Creating a Basic Configuration Template

This example shows how to create a basic configuration template. For a list of configuration settings, see Configuration Options.

PROMPT> elastic-beanstalk-create-configuration-template -a MySampleApp -t myconfigtemplate -E e-eup272zdrw

elastic-beanstalk-create-environment

Description

Launches an environment for the specified application using the specified configuration.

Syntax

elastic-beanstalk-create-environment -a [name] -l [label] -e [name] [-t [name] | -s [stack]] -c [prefix] -d [desc] -f[filename] -F [filename]

Options

Name Description Required

-a

--application-name name

The name of the application that contains the version to be deployed. If no application is found with this name, Elastic Beanstalk returns an InvalidParameterValue error.

Type: String

Default: None

Length Constraints: Minimum value of 1. Maximum value of 100.

Yes

-l

--version-label >label

The name of the application version to deploy.

If the specified application has no associated application versions, Elastic Beanstalk UpdateEnvironment returns an InvalidParameterValue error.

Default: If not specified, Elastic Beanstalk attempts to launch the sample application in the container.

Type: String

Default: None

Length Constraints: Minimum value of 1. Maximum value of 100.

No

-e

--environment-name name

A unique name for the deployment environment. Used in the application URL.

Constraint: Must be from 4 to 23 characters in length. The name can contain only letters, numbers, and hyphens. It cannot start or end with a hyphen. This name must be unique in your account. If the specified name already exists, Elastic Beanstalk returns an InvalidParameterValue.

Type: String

Default: If the CNAME parameter is not specified, the environment name becomes part of the CNAME, and therefore part of the visible URL for your application.

Yes

-t

--template-name name

The name of the configuration template to use in the deployment. If no configuration template is found with this name, Elastic Beanstalk returns an InvalidParameterValue error.

Conditional: You must specify either this parameter or a solution stack name, but not both. If you specify both, Elastic Beanstalk returns an InvalidParameterValue error. If you do not specify either, Elastic Beanstalk returns a MissingRequiredParameter.

Type: String

Default: None

Constraint: Must be unique for this application.

Conditional

-s

--solution-stack stack

This is the alternative to specifying a configuration name. If specified, Elastic Beanstalk sets the configuration values to the default values associated with the specified solution stack.

Condition: You must specify either this or a TemplateName, but not both. If you specify both, Elastic Beanstalk returns an InvalidParameterCombination error. If you do not specify either, Elastic Beanstalk returns MissingRequiredParameter error.

Type: String

Default: None

Conditional

-c

--cname-prefix prefix

If specified, the environment attempts to use this value as the prefix for the CNAME. If not specified, the environment uses the environment name.

Type: String

Default: None

Length Constraints: Minimum value of 4. Maximum value of 23.

No

-d

--description desc

The description of the environment.

Type: String

Default: None

No

-f

--options-file filename

The name of a JSON file that contains a set of key-value pairs defining configuration options for this new environment. These override the values obtained from the solution stack or the configuration template.

Type: String

No

-F

--options-to-remove-file value

The name of a JSON file that contains configuration options to remove from the configuration set for this new environment.

Type: String

Default: None

No

Output

The command returns a table with the following information:

  • ApplicationName—The name of the application associated with this environment.

  • CNAME—The URL to the CNAME for this environment.

  • DateCreated—The date the environment was created.

  • DateUpdated—The date the environment was last updated.

  • Description—The description of the environment.

  • EndpointURL—The URL to the load balancer for this environment.

  • EnvironmentID—The ID of this environment.

  • EnvironmentName—The name of this environment.

  • Health—Describes the health status of the environment. Elastic Beanstalk indicates the failure levels for a running environment:

    • Red: Indicates the environment is not responsive. Occurs when three or more consecutive failures occur for an environment.

    • Yellow: Indicates that something is wrong. Occurs when two consecutive failures occur for an environment.

    • Green: Indicates the environment is healthy and fully functional.

    • Gray: Default health for a new environment. The environment is not fully launched and health checks have not started or health checks are suspended during an UpdateEnvironment or RestartEnvironmentrequest.

  • Resources—A list of AWS resources used in this environment.

  • SolutionStackName—The name of the solution stack deployed with this environment.

  • Status—The current operational status of the environment:

    • Launching: Environment is in the process of initial deployment.

    • Updating: Environment is in the process of updating its configuration settings or application version.

    • Ready: Environment is available to have an action performed on it, such as update or terminate.

    • Terminating: Environment is in the shut-down process.

    • Terminated: Environment is not running.

  • TemplateName—The name of the configuration template used to originally launch this environment.

  • VersionLabel—The application version deployed in this environment.

Examples

Creating an Environment Using a Basic Configuration Template

This example shows how to create an environment using a basic configuration template as well as pass in a file to edit configuration settings and a file to remove configuration settings. For a list of configuration settings, see Configuration Options.

$ elastic-beanstalk-create-environment -a MySampleApp -t myconfigtemplate -e MySampleAppEnv -f options.txt -F options_remove.txt

options.txt

[ { "Namespace": "aws:autoscaling:asg", "OptionName": "MinSize", "Value": "2" }, { "Namespace": "aws:autoscaling:asg", "OptionName": "MaxSize", "Value": "3" } ]

options_remove.txt

[ { "Namespace": "aws:elasticbeanstalk:sns:topics", "OptionName": "PARAM4" } ]

elastic-beanstalk-create-storage-location

Description

Creates theAmazon S3 storage location for the account. This location is used to store user log files and is used by the AWS Management Console to upload application versions. You do not need to create this bucket in order to work with Elastic Beanstalk.

Syntax

elastic-beanstalk-create-storage-location

Examples

Creating the Storage Location

This example shows how to create a storage location.

PROMPT> elastic-beanstalk-create-storage-location

This command will output the name of the Amazon S3 bucket created.

elastic-beanstalk-delete-application

Description

Deletes the specified application along with all associated versions and configurations.

Note

You cannot delete an application that has a running environment.

Syntax

elastic-beanstalk-delete-application -a [name] -f

Options

Name Description Required

-a

--application-name name

The name of the application to delete.

Type: String

Default: None

Length Constraints: Minimum value of 1. Maximum value of 100.

Yes

-f

--force-terminate-env

Determines if all running environments should be deleted before deleting the application.

Type: Boolean

Valid Values: true | false

Default: false

No

Output

The command returns the string Application deleted.

Examples

Deleting an Application

This example shows how to delete an application.

PROMPT> elastic-beanstalk-delete-application -a MySampleApp

elastic-beanstalk-delete-application-version

Description

Deletes the specified version from the specified application.

Note

You cannot delete an application version that is associated with a running environment.

Syntax

elastic-beanstalk-delete-application-version -a [name] -l [label] -d

Options

Name Description Required

-a

--application-name name

The name of the application to delete releases from.

Type: String

Default: None

Yes

-l

--version-label

The label of the version to delete.

Type: String

Default: None

Length Constraints: Minimum value of 1. Maximum value of 100.

Yes

-d

--delete-source-bundle

Indicates whether to delete the associated source bundle from Amazon S3.

true: An attempt is made to delete the associated Amazon S3 source bundle specified at time of creation.

false: No action is taken on the Amazon S3 source bundle specified at time of creation.

Type: Boolean

Valid Values: true | false

Default: false

No

Output

The command returns the string Application version deleted.

Examples

Deleting an Application Version

This example shows how to delete an application version.

PROMPT> elastic-beanstalk-delete-application-version -a MySampleApp -l MyAppVersion

Deleting an Application Version and Amazon S3 Source Bundle

This example shows how to delete an application version.

PROMPT> elastic-beanstalk-delete-application-version -a MySampleApp -l MyAppVersion -d

elastic-beanstalk-delete-configuration-template

Description

Deletes the specified configuration template.

Note

When you launch an environment using a configuration template, the environment gets a copy of the template. You can delete or modify the environment's copy of the template without affecting the running environment.

Syntax

elastic-beanstalk-delete-configuration-template -a [name] -t [name]

Options

Name Description Required

-a

--application-name name

The name of the application to delete the configuration template from.

Type: String

Default: None

Length Constraints: Minimum value of 1. Maximum value of 100.

Yes

-t

--template-name

The name of the configuration template to delete.

Type: String

Default: None

Length Constraints: Minimum value of 1. Maximum value of 100.

Yes

Output

The command returns the string Configuration template deleted.

Examples

Deleting a Configuration Template

This example shows how to delete a configuration template.

PROMPT> elastic-beanstalk-delete-configuration-template -a MySampleApp -t MyConfigTemplate

elastic-beanstalk-delete-environment-configuration

Description

Deletes the draft configuration associated with the running environment.

Note

Updating a running environment with any configuration changes creates a draft configuration set. You can get the draft configuration using elastic-beanstalk-describe-configuration-settings while the update is in progress or if the update fails. The deployment status for the draft configuration indicates whether the deployment is in process or has failed. The draft configuration remains in existence until it is deleted with this action.

Syntax

elastic-beanstalk-delete-environment-configuration -a [name] -e [name]

Options

Name Description Required

-a

--application-name name

The name of the application the environment is associated with.

Type: String

Default: None

Length Constraints: Minimum value of 1. Maximum value of 100.

Yes

-e

--environment-name name

The name of the environment to delete the draft configuration from.

Type: String

Default: None

Length Constraints: Minimum value of 4. Maximum value of 23.

Yes

Output

The command returns the string Environment configuration deleted.

Examples

Deleting a Configuration Template

This example shows how to delete a configuration template.

PROMPT> elastic-beanstalk-delete-environment-configuration -a MySampleApp -e MyEnvConfig

elastic-beanstalk-describe-application-versions

Description

Returns information about existing application versions.

Syntax

elastic-beanstalk-describe-application-versions -a [name] -l [labels [,label..]]

Options

Name Description Required

-a

--application-name value

The name of the application. If specified, Elastic Beanstalk restricts the returned descriptions to only include ones that are associated with the specified application.

Type: String

Default: None

Length Constraints: Minimum value of 1. Maximum value of 100.

No

-l

--version-label labels

Comma-delimited list of version labels. If specified, restricts the returned descriptions to only include ones that have the specified version labels.

Type: String[]

Default: None

No

Output

The command returns a table with the following information:

  • ApplicationName—The name of the application associated with this release.

  • DateCreated—The date the application was created.

  • DateUpdated—The date the application version was last updated.

  • Description—The description of the application version.

  • SourceBundle—The location where the source bundle is located for this version.

  • VersionLabel—A label uniquely identifying the version for the associated application.

Examples

Describing Application Versions

This example shows how to describe all application versions for this account.

PROMPT> elastic-beanstalk-describe-application-versions

Describing Application Versions for a Specified Application

This example shows how to describe application versions for a specific application.

PROMPT> elastic-beanstalk-describe-application-versions -a MyApplication

Describing Multiple Application Versions

This example shows how to describe multiple specified application versions.

PROMPT> elastic-beanstalk-describe-application-versions -l MyAppVersion1, MyAppVersion2

elastic-beanstalk-describe-applications

Description

Returns descriptions about existing applications.

Syntax

elastic-beanstalk-describe-applications -a [names [,name..]]

Options

Name Description Required

-a

--application-names name

The name of one or more applications, separated by commas. If specified, Elastic Beanstalk restricts the returned descriptions to only include those with the specified names.

Type: String[]

Default: None

No

Output

The command returns a table with the following information:

  • ApplicationName—The name of the application.

  • ConfigurationTemplates—A list of the configuration templates used to create the application.

  • DateCreated—The date the application was created.

  • DateUpdated—The date the application was last updated.

  • Description—The description of the application.

  • Versions—The names of the versions for this application.

Examples

Describing the Applications

This example shows how to describe all applications for this account.

PROMPT> elastic-beanstalk-describe-applications

Describing a Specific Application

This example shows how to describe a specific application.

PROMPT> elastic-beanstalk-describe-applications -a MyApplication

elastic-beanstalk-describe-configuration-options

Description

Describes the configuration options that are used in a particular configuration template or environment, or that a specified solution stack defines. The description includes the values, the options, their default values, and an indication of the required action on a running environment if an option value is changed.

Syntax

elastic-beanstalk-describe-configuration-options -a [name] -t [name] -e [name] -s [stack] -f [filename]

Options

Name Description Required

-a

--application-name name

The name of the application associated with the configuration template or environment. Only needed if you want to describe the configuration options associated with either the configuration template or environment.

Type: String

Default: None

Length Constraints: Minimum value of 1. Maximum value of 100.

No

-t

--template-name name

The name of the configuration template whose configuration options you want to describe.

Type: String

Default: None

Length Constraints: Minimum value of 1. Maximum value of 100.

No

-e

--environment-name name

The name of the environment whose configuration options you want to describe.

Type: String

Length Constraints: Minimum value of 4. Maximum value of 23.

No

-s

--solution-stack stack

The name of the solution stack whose configuration options you want to describe.

Type: String

Default: None

Length Constraints: Minimum value of 0. Maximum value of 100.

No

-f

--options-file filename

The name of a JSON file that contains the options you want described.

Type: String

No

Output

The command returns a table with the following information:

  • Options—A list of the configuration options.

  • SolutionStackName—The name of the SolutionStack these configuration options belong to.

Examples

Describing Configuration Options for an Environment

This example shows how to describe configuration options for an environment.

PROMPT> elastic-beanstalk-describe-configuration-options -a MySampleApp -t myconfigtemplate -e MySampleAppEnv

elastic-beanstalk-describe-configuration-settings

Description

Returns a description of the settings for the specified configuration set, that is, either a configuration template or the configuration set associated with a running environment.

When describing the settings for the configuration set associated with a running environment, it is possible to receive two sets of setting descriptions. One is the deployed configuration set, and the other is a draft configuration of an environment that is either in the process of deployment or that failed to deploy.

Syntax

elastic-beanstalk-describe-configuration-settings -a [name] [-t [name] | -e [name]]

Options

Name Description Required

-a

--application-name name

The application name for the environment or configuration template.

Type: String

Default: None

Length Constraints: Minimum value of 1. Maximum value of 100.

Yes

-t

--template-name name

The name of the configuration template to describe. If no configuration template is found with this name, Elastic Beanstalk returns an InvalidParameterValue error.

Conditional: You must specify either this parameter or an environment name, but not both. If you specify both, Elastic Beanstalk returns an InvalidParameterValue error. If you do not specify either, Elastic Beanstalk returns a Miss