On this page:

This page walks you through deploying a simple example application using a script provided by AppDynamics. The script takes care of the housekeeping needed to deploy with Elastic Beanstalk.

To continue, you must have

After you complete this demo, the next step is to deploy manually rather than running the script. See Deploying applications manually.

Choose monitoring and debugging options

Depending on the Controller you intend to use for monitoring, you can monitor the example application

Decide which scenario suits your purposes. Then, use the table below to identify the corresponding tutorial target directory. Later on, you will need to know this directory path.


AnalyticsServer VisibilityTutorial Target Directory
yesyes OR noaws-elasticbeanstalk/java-machine-analytics


Finally, decide whether or not to SSH into the EC2 instance on which the application runs. Development, test, and staging environments require this technique more often than production environments.

Create a VPC and a Key Pair

In the AWS console:

If you want to SSH into EC2 instances:

Construct the test.sh command

To deploy applications with Elastic Beanstalk, you need to know the variable settings for every AppDynamics Agent your application needs. This tutorial uses the Java Agent only, which keeps the list of required settings short.

In a text editor, create a string that begins with ./test.sh

Append the script options and environment variable settings to the command string, as described in the table below. See the example command string below the table.

The completed string is your test.sh command.

Script optionEnvironment variableNotes
  • Fully-qualified domain name for the AppDynamics Controller with which you intend to monitor your application
  • Primary port used by the monitoring AppDynamics Controller
  • Default is 8090
  • the Controller under Settings > License > Account


  • Include only if your Controller has Analytics
  • Tells the Analytics plugin the target URL for the Events Service
  • The Analytics plugin sends data to the Events Service, not the Controller


  • Include only if your Controller has Analytics
  • In the Controller under Settings > License > Account


  • Must be the code for the region shown in your AWS console.
  • For example, if the console shows Ohio, the code is us-east-2


  • Name of your choice for the example application
  • Name of your choice, for the new environment that the script creates


  • Specifies where on the local filesystem the script should copy the Sample App, after cloning it from GitHub


  • Include only if you want to use eb ssh 
  • eb ssh allows you to log into the EC2 instance on which the script deploys the app
  • For the value, use the name of your chosen Key Pair
  • Optional—if not specified, AWS uses a default
  • Must be t2.small or larger for this demo to run properly

The simplest possible test.sh command (no Analytics, no Server Visibility, no SSH) might look something like this:

./test.sh -c master-saas-controller.example.com -p 8090 -K <your-secret-key> -r us-east-2 -a tutorialapp -e tutorialenv -b /Users/exampleperson/aws-elasticbeanstalk/java -i t2.small

A note about security

Do not use the procedure as described here, with your secret key entered at the command line in plain text, in a production environment.

It may or may not be considered acceptable even for testing, depending on practices at your organization. See Best Practices for Managing AWS Access Keys.

Set up the demo and the CLI

All file paths in these examples begin with the home directory, designated by the ~ character. Replace the ~ with whatever filesystem location you prefer.

In a terminal:

Run the demo script

In a terminal, still in the tutorial target directory.

Verify that the EC2 Node is Registered with the Controller

In the Controller, you should see the example application under Applications.

Verify that the Application is Running in the Cloud

In the Elastic Beanstalk console, you should see the example application under All Applications and the environment you named at launch.

Monitor your Cloud Application with AppDynamics

You should be able to view the example in the Flow Map, and (if applicable) Analytics Agent and/or Server Visibility screens.

Deploying applications manually