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

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

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
INFO: swapEnvironmentCNAMEs is starting.
INFO: Swapping CNAMEs for environments 'tmp-dev' and 'live-env'.
INFO: 'tmp-dev.elasticbeanstalk.com' now points to 'awseb-e-j-AWSEBLoa-M7U21VXNLWHN-487871449.us-west-2.elb.amazonaws.com'.
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
INFO: swapEnvironmentCNAMEs is starting.
INFO: Swapping CNAMEs for environments 'tmp-dev' and 'live-env'.
INFO: 'tmp-dev.elasticbeanstalk.com' now points to 'awseb-e-j-AWSEBLoa-M7U21VXNLWHN-487871449.us-west-2.elb.amazonaws.com'.
INFO: Completed swapping CNAMEs for environments 'tmp-dev' and 'live-env'.