Menu
AWS Elastic Beanstalk
Developer Guide (API Version 2010-12-01)

eb create

Description

Create a new environment.

Note

To use create on a .NET application, you must create a deployment package as described in Creating a Source Bundle for a .NET Application, then set up the CLI configuration to deploy the package as an artifact as described in Deploying an Artifact Instead of the Project Folder.

Note

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

Syntax

eb create

eb create environment-name

eb create environment-name-1 environment-name-2 (see Compose Environments)

Environment names must be between 4 and 40 characters long and can only contain letters, numbers, and hyphens. Environment names can't begin or end with a hyphen.

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

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

-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 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 web site.

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, then EB CLI prompts you for the master database 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 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_type

or

--database.instance instance_type

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 even if you didn't run the command with the --database option.

Type: String

Valid values: See Option Values.

-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 even if you didn't run the command with the --database option.

-db.size number_of_gigabytes

or

--database.size number_of_gigabytes

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 even if you didn't run the command with the --database option.

Type: Number

Valid values:

  • MySQL5 to 1024. The default is 5.

  • Postgres5 to 1024. The default is 5.

  • Oracle10 to 1024. The default is 10.

  • Microsoft SQL Server Express Edition30.

  • Microsoft SQL Server Web Edition30.

  • Microsoft SQL Server Standard Edition200.

-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

Allows you 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 is not present.

--elb-type type

Set the load balancer type to classic or application.

--env-group-suffix groupname Group name to append to the environment name. Only for use with Compose Environments.

--envvars

Environment properties in a comma-separated list with the format name=value.

Constraints:

  • Key-value pairs must be separated by commas.

  • Keys and values can contain any alphabetic character in any language, any numeric character, white space, invisible separator, and the following symbols: _ . : / = + \ - @

  • Keys can contain up to 128 characters. Values can contain up to 256 characters.

  • Keys and values are case sensitive.

  • Values cannot match the environment name.

  • Values cannot include either aws: or elasticbeanstalk:.

  • The combined size of all environment properties cannot exceed 4096 bytes.

-ip profile_name

or

--instance_profile profile_name

The instance profile with the IAM role with the temporary security credentials that your application needs to access AWS resources.

-i

or

--instance_type

The type of Amazon EC2 instance to use in the environment.

Valid values: See Option Values.

-k key_name

or

--keyname key_name

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. 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 is registered with Amazon EC2

--modules component-a component-b

List of component environments to create. Only for use with Compose Environments.

-p platform-configuration

or

--platform platform-configuration

The platform configuration to use. You can specify a platform, platform configuration, or solution stack name. For example:

  • php - the latest available PHP configuration

  • php-5.5 - the latest PHP 5.5 configuration

  • "64bit Amazon Linux 2016.03 v2.1.5 running PHP 7.0" - PHP 7.0 version 2.1.5

Use eb platform list to get a list of available configurations.

-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 AWS region in which you want to deploy the application.

For the list of values you can specify for this option, see AWS Elastic Beanstalk in the Regions and Endpoints topic 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.

Note

Do not enter an ARN, just the role name. Elastic Beanstalk prefixes the role name with the correct values to create the resulting ARN internally.

--single

Create the environment without a load balancer.

--tags name=value

Tag the resources in your environment. Separate multiple tags with a comma.

-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_label

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.

--vpc.elbsubnets subnet1,subnet2

Specifies subnets for the Elastic Load Balancing load balancer in a VPC.

--vpc.id ID

Launches your environment in the specified VPC.

--vpc.publicip

Launches your Amazon EC2 instances in a public subnet in your VPC.

--vpc.securitygroups securitygroup1,securitygroup2

Specifies the security group ID or security group name. Required when --vpc.id is specified.

Common options

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 operation to get more details.

If you enabled AWS CodeBuild support in your application, eb create displays information from AWS CodeBuild as your code is built. Learn more about AWS CodeBuild support in Elastic Beanstalk in the Using the EB CLI with AWS CodeBuild topic.

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
(default is 1): 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 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-east-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-east-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:
...