class AWS::ELB::BackendServerPolicyCollection


# returns a policy or nil
You can also get the current policy:<br><br>load_balancer.backend_server_policies = nil
# removes the policy from instance port 80
If you want to remove the policy you can pass nil instead.<br><br>load_balancer.backend_server_policies = backend_policy
can assign it to a backend instance port:
Once you have created a backend server authentication policy, you
’BackendServerAuthenticationPolicyType’, attributes)
backend_policy = @load_balancer.policies.create(name, type, attributes)
}
‘PublicKeyPolicyName’ => [public_key_policy]
# note: you can pass more than one public key policy here
attributes = {
type = ‘BackendServerAuthenticationPolicyType’
name = ‘backend-policy’
# step 2, create the backend server policy, passing the public key policy
’PublicKeyPolicyType’, ‘PublicKey’ => public_key.strip)
public_key_policy = load_balancer.policies.create(“pkp”,
KEY
—–END CERTIFICATE—–
o50MymfqtoVcebZcXbiDVAXW1cPEHKLBXecX6/LZ+GOzEsUOxgt7Xs9uabqp
.…
MIICaTCCAdICCQDuvCF4erLGSjANBgkqhkiG9w0BAQUFADB5MQswCQYDVQQGEwJa
—–BEGIN CERTIFICATE—–
public_key1 = <<-KEY
# step 1, create one (or more) PublicKeyPolicyType policies
must create on of the appropriate type:
Before you can assign a policy to a backend server instance port you
attribute, a list of public key policies.
BackendServerAuthenticationPolicyType policy only has one
Creating a backend server policy can be a bit tricky. A
== Creating a Backend Server Policy
Helps manage policies assigned to backend server instnace ports.

def [] instance_port

Returns:
  • (LoadBalancerPolicy, nil) - Returns the load balancer policy

Parameters:
  • instance_port (Integer) -- The backend server port to
def [] instance_port
  enum(:instance_port => instance_port).first
end

def []= instance_port, policy

Returns:
  • (nil) -

Parameters:
  • policy (String, LoadBalancerPolicy, nil) -- Load balancer policy
  • instance_port (Integer) -- The instance port you want to set
def []= instance_port, policy
  client.set_load_balancer_policies_for_backend_server(
    :load_balancer_name => load_balancer.name,
    :instance_port => instance_port.to_i,
    :policy_names => [policy_name(policy)].compact)
  nil
end

def _each_item options = {}

def _each_item options = {}
  instance_port = options[:instance_port]
  load_balancer.backend_server_descriptions.each do |desc|
    if instance_port.nil? or desc.instance_port == instance_port
      desc.policy_names.collect do |policy_name|
        policy = load_balancer.policies[policy_name]
        yield(policy)
      end
    end
  end
end

def initialize load_balancer, options = {}

def initialize load_balancer, options = {}
  @load_balancer = load_balancer
  super
end

def policy_name policy

def policy_name policy
  case policy
  when nil then nil
  when LoadBalancerPolicy then policy.name
  else policy.to_s
  end
end