create_configuration_template ( $application_name, $template_name, $opt )

Creates a configuration template. Templates are associated with a specific application and are used to deploy different versions of the application with the same configuration settings.

Related Topics

  • DescribeConfigurationOptions
  • DescribeConfigurationSettings
  • ListAvailableSolutionStacks

Access

public

Parameters

Parameter

Type

Required

Description

$application_name

string

Required

The name of the application to associate with this configuration template. If no application is found with this name, AWS Elastic Beanstalk returns an InvalidParameterValue error.

$template_name

string

Required

The name of the configuration template. Constraint: This name must be unique per application. Default: If a configuration template already exists with this name, AWS Elastic Beanstalk returns an InvalidParameterValue error.

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • SolutionStackName - string - Optional - The name of the solution stack used by this configuration. The solution stack specifies the operating system, architecture, and application server for a configuration template. It determines the set of configuration options as well as the possible and default values. Use ListAvailableSolutionStacks to obtain a list of available solution stacks. Default: If the SolutionStackName is not specified and the source configuration parameter is blank, AWS Elastic Beanstalk uses the default solution stack. If not specified and the source configuration parameter is specified, AWS Elastic Beanstalk uses the same solution stack as the source configuration template.
  • SourceConfiguration - array - Optional - If specified, AWS Elastic Beanstalk uses the configuration values from the specified configuration template to create a new configuration. Values specified in the OptionSettings parameter of this call overrides any values obtained from the SourceConfiguration. If no configuration template is found, returns an InvalidParameterValue error. Constraint: If both the solution stack name parameter and the source configuration parameters are specified, the solution stack of the source configuration template must match the specified solution stack name or else AWS Elastic Beanstalk returns an InvalidParameterCombination error.
    • x - array - Optional - This represents a simple array index.
      • ApplicationName - string - Optional - The name of the application associated with the configuration.
      • TemplateName - string - Optional - The name of the configuration template.
  • EnvironmentId - string - Optional - The ID of the environment used with this configuration template.
  • Description - string - Optional - Describes this configuration.
  • OptionSettings - array - Optional - If specified, AWS Elastic Beanstalk sets the specified configuration option to the requested value. The new value overrides the value obtained from the solution stack or the source configuration template.
    • x - array - Optional - This represents a simple array index.
      • Namespace - string - Optional - A unique namespace identifying the option’s associated AWS resource.
      • OptionName - string - Optional - The name of the configuration option.
      • Value - string - Optional - The current value for the configuration option.
  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Creates a new configuration template.

// Instantiate the class
$bean = new AmazonElasticBeanstalk();

$response = $bean->create_configuration_template('my-application', 'my-template', array(
	'SolutionStackName' => '32bit Amazon Linux running Tomcat 6',
	'Description' => 'This is my default template.',
	'OptionSettings' => array(
		array(
			'Namespace' => 'aws:elasticbeanstalk:sns:topics',
			'OptionName' => 'Notification Topic Name',
			'Value' => 'elasticbeanstalk-event-topic'
		),
		array(
			'Namespace' => 'aws:elasticbeanstalk:sns:topics',
			'OptionName' => 'Notification Protocol',
			'Value' => 'sqs'
		),
		array(
			'Namespace' => 'aws:elasticbeanstalk:sns:topics',
			'OptionName' => 'Notification Topic ARN',
			'Value' => 'arn:aws:sqs:us-east-1:0123456789012:elasticbeanstalk-event-queue'
		)
	)
));

// Success?
var_dump($response->isOK());
Result:
bool(true)

Related Methods

Source

Method defined in services/elasticbeanstalk.class.php | Toggle source view (26 lines) | View on GitHub

public function create_configuration_template($application_name, $template_name, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['ApplicationName'] = $application_name;
    $opt['TemplateName'] = $template_name;
    
    // Optional map (non-list)
    if (isset($opt['SourceConfiguration']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'SourceConfiguration' => $opt['SourceConfiguration']
        ), 'member'));
        unset($opt['SourceConfiguration']);
    }
    
    // Optional list + map
    if (isset($opt['OptionSettings']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'OptionSettings' => $opt['OptionSettings']
        ), 'member'));
        unset($opt['OptionSettings']);
    }

    return $this->authenticate('CreateConfigurationTemplate', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback