create_load_balancer_policy ( $load_balancer_name, $policy_name, $policy_type_name, $opt )

Creates a new policy that contains the necessary attributes depending on the policy type. Policies are settings that are saved for your Elastic LoadBalancer and that can be applied to the front-end listener, or the back-end application server, depending on your policy type.

Access

public

Parameters

Parameter

Type

Required

Description

$load_balancer_name

string

Required

The name associated with the LoadBalancer for which the policy is being created. This name must be unique within the client AWS account.

$policy_name

string

Required

The name of the LoadBalancer policy being created. The name must be unique within the set of policies for this LoadBalancer.

$policy_type_name

string

Required

The name of the base policy type being used to create this policy. To get the list of policy types, use the DescribeLoadBalancerPolicyTypes action.

$opt

array

Optional

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

  • PolicyAttributes - array - Optional - A list of attributes associated with the policy being created.
    • x - array - Optional - This represents a simple array index.
      • AttributeName - string - Optional - The name of the attribute associated with the policy.
      • AttributeValue - string - Optional - The value of the attribute associated with the policy.
  • 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.

Source

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

public function create_load_balancer_policy($load_balancer_name, $policy_name, $policy_type_name, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['LoadBalancerName'] = $load_balancer_name;
    $opt['PolicyName'] = $policy_name;
    $opt['PolicyTypeName'] = $policy_type_name;
    
    // Optional list + map
    if (isset($opt['PolicyAttributes']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'PolicyAttributes' => $opt['PolicyAttributes']
        ), 'member'));
        unset($opt['PolicyAttributes']);
    }

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

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback