AWS User Data

When you launch a Zend Server instance on AWS you have the option of passing user data to the instance that can be used to perform common automated configuration tasks and even run scripts after the instance starts.

This user data is used during a manual launch process, in JSON format, and can include the following fields:

Name Type Description
ZEND_ADMIN_PASSWORD string Password for the admin user of Zend Server. If it is set without ZEND_CLUSTER_* parameters, it will bootstrap Zend Server and setup an admin password.
ZEND_GIT_REPO string URL of a git repository which is deployed to the default virtual host document root.
ZEND_S3_BUCKET string Name of S3 bucket from which files are downloaded to default virtual host document root.
ZEND_S3_PREFIX string If set, then only files with that prefix will be downloaded to the default virtual host document root (take into account that the prefix will be present in any files downloaded, so if you restrict it to a folder, the folder will be downloaded to document root).
ZEND_ZPK array Optional information about ZPK that should be deployed during startup. Note that for this to work you must specify ZEND_ADMIN_PASSWORD. For structure of this array see table of ZPK parameters.
ZEND_DOCUMENT_ROOT string Document root relative to the system default document root. Should be used with git or S3 deployment (just set it to path relative to your git repository or S3 folder).
ZEND_SCRIPT_URL string URL from which custom script should be downloaded and executed.
ZEND_SCRIPT_PATH string Absolute path including filename where custom script must be placed. After a reboot, this file will be overwritten by re-downloaded script.
ZEND_CLUSTER_DB_HOST string MySQL DB hostname for Zend Cluster.
ZEND_CLUSTER_DB_USER string MySQL DB user for Zend Cluster.
ZEND_CLUSTER_DB_PASSWORD string MySQL DB password for Zend Cluster.
AWS_ACCESS_KEY string Access key to use for all AWS S3 operations.
AWS_SECRET_KEY string Secret key to use for all AWS S3 operations.
ZEND_DEBUG bool Set to true to start Zend Server in debug mode with maximum log verbosity (WARNING: do not use this on production systems!).



URL from which custom preparation script must be downloaded and executed. Preparation script is run before any other actions of zs-init. It is intended for customization that has to be done before deploying applications (for example local MySQL server installation).



Absolute path to where custom preparation script must be placed. If path is a directory, then script is saved in that directory with filename extracted from URL. After reboot this file will be overwritten by re-downloaded script.



Access key to use for all AWS S3 operations.



Secret key to use for all AWS S3 operations.

ZEND_ZPK structure

Name Type Description



Array in which each item is an object that describes a deployment that will be done after Zend Server starts.

Following is a list of keys of such objects.




Required for "git" and "zpk" deployments. Specifies URL from which git repository or ZPK file should be downloaded.




Required for "zpk" deployment. Name of application that will appear in Zend Server UI after deployment.




Required for "zpk" deployment. Array of additional parameters that is passed to Zend Server during ZPK deployment. Keys of this array are names of parameters and respective values are values of parameters. Parameter values are scanned for string $IP and if it is found, then it is replaced with external IP of instance. This is useful, for example, when deploying Wordpress application.




Required and must be one of "git", "s3" or "zpk".




Required for all deployments and specifies into which path web application should be deployed. To deploy application to root, specify "/".




optional for "git" and "s3" deployments. If specified, indicates which folder inside a deployment should be document root (or in case application is not deployed to root, which directory should be aliased in apache).




Required for "s3" deployment. Specifies from which S3 bucket application should be downloaded.




Optional for "s3" deployment. Specifies which directory in S3 bucket should be downloaded.


Here is a simple example of a JSON file containing user data defining the admin password for accessing the Zend Server UI.