AWS cloud formation user data

General discussion forum for the Zend Server
hugu9897
Posts: 5
Joined: Mon Nov 04, 2013 4:19 pm

AWS cloud formation user data

Post by hugu9897 » Mon Nov 04, 2013 4:36 pm

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

User avatar
zend_amir
Posts: 64
Joined: Thu Jan 22, 2009 4:27 pm

Re: AWS cloud formation user data

Post by zend_amir » Tue Nov 05, 2013 8:11 am

Do you use Zend's cloud formation template and Zend's Zend server ami or did you develop your own?

hugu9897
Posts: 5
Joined: Mon Nov 04, 2013 4:19 pm

Re: AWS cloud formation user data

Post by hugu9897 » Tue Nov 05, 2013 9:28 am

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 ?

User avatar
zend_amir
Posts: 64
Joined: Thu Jan 22, 2009 4:27 pm

Re: AWS cloud formation user data

Post by zend_amir » Tue Nov 05, 2013 9:39 am

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.

User avatar
zend_amir
Posts: 64
Joined: Thu Jan 22, 2009 4:27 pm

Re: AWS cloud formation user data

Post by zend_amir » Tue Nov 05, 2013 10:35 am

Sorry, I cannot instruct you on doing that. It's not possible with marketplace AMIs

hugu9897
Posts: 5
Joined: Mon Nov 04, 2013 4:19 pm

Re: AWS cloud formation user data

Post by hugu9897 » Tue Nov 05, 2013 11:01 am

There is a way to custom Zend Server ami to do that?
Is it possible to have the admin Api Key on the output?

dima_z_zend
Posts: 15
Joined: Sun Jul 17, 2011 3:17 pm
Location: Ramat Gan, Israel

Re: AWS cloud formation user data

Post by dima_z_zend » Tue Nov 05, 2013 1:58 pm

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.
Dmitry Zbarski
Cloud Integration Engineer
Zend Technologies, Ltd.

hugu9897
Posts: 5
Joined: Mon Nov 04, 2013 4:19 pm

Re: AWS cloud formation user data

Post by hugu9897 » Tue Nov 12, 2013 10:34 am

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 ?

lili5973
Posts: 1
Joined: Tue Nov 26, 2013 7:08 am

Re: AWS cloud formation user data

Post by lili5973 » Tue Nov 26, 2013 7:13 am

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 ?

dima_z_zend
Posts: 15
Joined: Sun Jul 17, 2011 3:17 pm
Location: Ramat Gan, Israel

Re: AWS cloud formation user data

Post by dima_z_zend » Thu Nov 28, 2013 5:30 pm

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.
Dmitry Zbarski
Cloud Integration Engineer
Zend Technologies, Ltd.

Post Reply