eb-env.js
Show and update an ElasticBeanstalk environment from the command line or a node.js application.
Command line
Installation
npm install elastic-beanstalk-environment -g
Usage
Usage: eb-env [options] [command]
Commands:
show [setting] Show environment setting(s) and status
update [options] [KEY=VALUE...] Update environment setting(s)
Options:
-h, --help output usage information
-V, --version output the version number
-q, --quiet output fatal errors only
--no-color no colors for verbose output
-r, --region [region] AWS region
--profile [profile] AWS profile
-a, --application [name] Elastic Beanstalk application name
-e, --environment [name] Elastic Beanstalk environment name
If --profile
is specified, a profile will be loaded from ~/.aws/credentials
.
The environment variables AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
and AWS_SESSION_TOKEN
may be used for authentication.
Alternatively the environment variable AWS_REGION
may be used instead of --region
and
AWS_PROFILE
can be used instead of --profile
Show command
Usage: eb-env show [options] [setting]
Show environment setting(s) and status
Options:
-h, --help output usage information
Global options are also available.
Update command
Usage: eb-env update [options] [KEY=VALUE...]
Update environment setting(s)
Options:
-h, --help output usage information
-w, --wait [seconds] Wait max X seconds for the update to complete
--version [label] Deploy a version
--description [description] Change the environment description
--config [template_name] Change the environment configuration using a template
--platform [name] Change the platform (aka solution stack)
--show Show environment after update
Global options are also available.
Examples
# Show environment settings
eb-env -a my-eb-app -e some-env -r eu-west-1 show
# Show a single environment setting
eb-env -a my-eb-app -e some-env -r eu-west-1 show version
# Show a single environment variable
eb-env -a my-eb-app -e some-env -r eu-west-1 show vars.APPLICATION_ENV
# Update the environment description
eb-env -a my-eb-app -e some-env -r eu-west-1 update --description "A very nice description"
# Update the environment version and the FOO env var.
eb-env -a my-eb-app -e some-env -r eu-west-1 update --version 1.2.8 FOO=bar
# Update the env vars and wait for completion (max 3 minutes)
eb-env -a my-eb-app -e some-env -r eu-west-1 update FOO=bar QUX=bar --wait 180
Library
Installation
npm install eb-env --save
Load environment
var AWS = ;var EBEnv = ; AWS 'my-eb-app' 'some-env';
Update environment
var AWS = ;var EBEnv = ; var env = AWS 'my-eb-app' 'some-env'; envversion = '1.2.8';envdescription = 'A very nice description';envvarsFOO = 'bar'; env