Orbitera automatically passes certain internal parameters such as the customer's name, email address, and identifier to CloudFormation scripts. The following is an example of how to accept these parameters in your CF script.


{
  "AWSTemplateFormatVersion" : "2010-09-09",
  "Description" : "Template description",
  "Parameters" : {
    /* Stack-specific parameters go here, if any */
    "orbiteraCustomerName" : {
      "Description" : "The name of the customer that launches the Test Drive",
      "Type" : "String",
      "MinLength": "0",
      "MaxLength": "255",
      "Default" : ""
    },
    "orbiteraCustomerEmail" : {
      "Description" : "The e-mail address of the customer that launches the Test Drive",
      "Type" : "String",
      "MinLength": "0",
      "MaxLength": "255",
      "Default" : ""
    },
    "orbiteraCustomerAWSAccount" : {
      "Description" : "The AWS account assigned within Orbitera to the customer that launches the Test Drive",
      "Type" : "String",
      "MinLength": "0",
      "MaxLength": "255",
      "Default" : ""
    },

     "orbiteraCustomerId" : {

      "Description" : "A unique numerical ID for each customer",

      "Type" : "String",

      "MinLength": "0",

      "MaxLength": "255",

      "Default" : ""

    }

  },
 /* The rest of the stack configuration goes here */

  /* The parameters can be embeded in the stack by placing the following codes where the parameter value is needed:
      {"Ref": "orbiteraCustomerName"}
      {"Ref": "orbiteraCustomerEmail"}
      {"Ref": "orbiteraCustomerAWSAccount"}

      {"Ref": "orbiteraCustomerId"}

      For example, defining a EC2 instance with an already populated config file:
   */
  "Resources" : {
   /* ... */
    "BackendHost"  : {
      "Type" : "AWS::EC2::Instance",
      "Metadata" : {
        "AWS::CloudFormation::Init" : {
          "config" : {
            "files" : {
              "/var/www/html/config.php" : {
                "content" : { "Fn::Join" : ["", [
                  "<?php\n",
                  "define('USER_NAME',  '", {"Ref" : "orbiteraCustomerName"}, "');\n",
                  "define('USER_EMAIL', '", {"Ref" : "orbiteraCustomerEmail"}, "');\n"

                  "define('USER_ID', '", {"Ref" : "orbiteraCustomerId"}, "');\n"

                ]] },
                "mode" : "000644",
                "owner" : "root",
                "group" : "root"
              }
            },
            "services" : {
              "sysvinit" : {
                "httpd"    : { "enabled" : "true", "ensureRunning" : "true" },
                "sendmail" : { "enabled" : "false", "ensureRunning" : "false" }
              }
            }
          }
        }
      }
    }
  }
}