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
5DZxDLIExOSHiFGwWg5m8NgcirH2diveyRBgNhgC6S6DntkEMvAV0yvaQgHtUO53
SIb3DQEBBQUAA4GBAD+VNA6ia8TXa2lJgvmoGYCLGcCaccz7Nv/u4/oqv8qMPvdZ
ZoUKaOymfAN8l/MJbcPH0rTYNdni99B+UMPWmFeRg/BeWiy2hwIDAQABMA0GCSqG
SMFTXAvmH1FVqNO97wVG6ydxi+LNE7Jub62QQnsK420y+nXRTytxrboH1eAiAIEt
iQKBgQC4vy7K2LCgYJs7AbxdanPEwL4KLC9gi1LqzkRWShEaz8COUZswcOkevLQy
hvcNAQkBFhBmYWtlQGV4YW1wbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
VQQKEwRGQUtFMQ0wCwYDVQQLEwRGQUtFMQ0wCwYDVQQDEwRGQUtFMR8wHQYJKoZI
CzAJBgNVBAYTAlpaMQ0wCwYDVQQIEwRGQUtFMQ0wCwYDVQQHEwRGQUtFMQ0wCwYD
ZUBleGFtcGxlLmNvbTAeFw0xMTA4MTAyMjE0NDVaFw0xMjA4MDkyMjE0NDVaMHkx
MAsGA1UECxMERkFLRTENMAsGA1UEAxMERkFLRTEfMB0GCSqGSIb3DQEJARYQZmFr
WjENMAsGA1UECBMERkFLRTENMAsGA1UEBxMERkFLRTENMAsGA1UEChMERkFLRTEN
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:
  • policies (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