Page 1 of 2

AWS cloud formation user data

Posted: Mon Nov 04, 2013 4:36 pm
by hugu9897
Hi all,

i use AWS cloud formation to create zend cluster instances. i use "userData" parameter to set ZEND_CLUSTER_PASSWORD, ZEND_CLUSTER_DB_HOST, ZEND_CLUSTER_DB_USER, ZEND_CLUSTER_DB_PASSWORD and it works very nice !
I use jenkins with AWS cloud formation and i want to set API KEY to deploy on the Zend Server. Is there a specific "userData" to set the API KEY like ZEND_CLUSTER_PASSWORD ?
I dont find any documentation for user data parameters and any help will be welcome.

Thx

Re: AWS cloud formation user data

Posted: Tue Nov 05, 2013 8:11 am
by zend_amir
Do you use Zend's cloud formation template and Zend's Zend server ami or did you develop your own?

Re: AWS cloud formation user data

Posted: Tue Nov 05, 2013 9:28 am
by hugu9897
Yes i use Zend Cloud formation template with zend server ami with userData like this :

Code: Select all

"UserData": {
          "Fn::Base64": {
            "Fn::Join": [
              "",
              [
                "ZEND_CLUSTER_PASSWORD=",
                { "Ref": "CMPassword" },
                "\n",
                "ZEND_CLUSTER_DB_HOST=",
                 { "Ref": "DataBaseUrl" },
                "\n",
                "ZEND_CLUSTER_DB_USER=",
                { "Ref" : "DatabaseUser" },
                "\n",
                "ZEND_CLUSTER_DB_PASSWORD=",
                { "Ref" : "DatabasePassword" },
                "\n"
              ]
            ]
          }
        },
There is a way to pass API_KEY or maybe retreive the admin api key from the Outputs ?

Re: AWS cloud formation user data

Posted: Tue Nov 05, 2013 9:39 am
by zend_amir
It is not possible with our latest ami and template.
I will see if we want to add this option for next version.
Do you want change the ami and template yourself and do it? I can try to instruct you on doing it.

Re: AWS cloud formation user data

Posted: Tue Nov 05, 2013 10:35 am
by zend_amir
Sorry, I cannot instruct you on doing that. It's not possible with marketplace AMIs

Re: AWS cloud formation user data

Posted: Tue Nov 05, 2013 11:01 am
by hugu9897
There is a way to custom Zend Server ami to do that?
Is it possible to have the admin Api Key on the output?

Re: AWS cloud formation user data

Posted: Tue Nov 05, 2013 1:58 pm
by dima_z_zend
Custom Zend Server AMI is problematic. Startup script in Zend Server AMI are designed to run only once after boot and configure everything.
If you start Zend Server instance on AWS and then try to create AMI from it you will finish with AMI that won't do anything with user data at boot.
So creating custom Zend Server AMI is definitely not an option.
About outputting admin WebAPI key. The question is where do you want it to be output? We currently do save cluster WebAPI key in /var/tmp/zend_cluster.sh file. This file is later used by Zend Server to deregister from Zend Cluster when instance is shutting down. So if you do take it from there, please do not modify this file.

Re: AWS cloud formation user data

Posted: Tue Nov 12, 2013 10:34 am
by hugu9897
Thx for your reply, i found a solution : i launch DB from a snapshot and then kept my configuration.
Is it possible to use Metadata property in the json file to create environement variable ?

Re: AWS cloud formation user data

Posted: Tue Nov 26, 2013 7:13 am
by lili5973
Thx for your response, i discovered a remedy : i release DB from a overview and then kept my settings.
Is it possible to use Meta-data residence in the json computer file to make environement varying ?

Re: AWS cloud formation user data

Posted: Thu Nov 28, 2013 5:30 pm
by dima_z_zend
I am afraid I did not understand what do you mean.
If you want to change environment variables on OS level using CloudFormation template, I am not sure this is possible.