createLoadBalancerPolicy
abstract suspend fun createLoadBalancerPolicy(input: CreateLoadBalancerPolicyRequest): CreateLoadBalancerPolicyResponse
Creates a policy with the specified attributes for the specified load balancer.
Policies are settings that are saved for your load balancer and that can be applied to the listener or the application server, depending on the policy type.
Samples
// This example creates a policy that enables Proxy Protocol on the specified load balancer.
elasticLoadBalancingClient.createLoadBalancerPolicy {
loadBalancerName = "my-load-balancer"
policyName = "my-ProxyProtocol-policy"
policyTypeName = "ProxyProtocolPolicyType"
policyAttributes = listOf<PolicyAttribute>(
PolicyAttribute {
attributeName = "ProxyProtocol"
attributeValue = "true"
}
)
}Content copied to clipboard
// This example creates a public key policy.
elasticLoadBalancingClient.createLoadBalancerPolicy {
loadBalancerName = "my-load-balancer"
policyName = "my-PublicKey-policy"
policyTypeName = "PublicKeyPolicyType"
policyAttributes = listOf<PolicyAttribute>(
PolicyAttribute {
attributeName = "PublicKey"
attributeValue = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwAYUjnfyEyXr1pxjhFWBpMlggUcqoi3kl+dS74kj//c6x7ROtusUaeQCTgIUkayttRDWchuqo1pHC1u+n5xxXnBBe2ejbb2WRsKIQ5rXEeixsjFpFsojpSQKkzhVGI6mJVZBJDVKSHmswnwLBdofLhzvllpovBPTHe+o4haAWvDBALJU0pkSI1FecPHcs2hwxf14zHoXy1e2k36A64nXW43wtfx5qcVSIxtCEOjnYRg7RPvybaGfQ+v6Iaxb/+7J5kEvZhTFQId+bSiJImF1FSUT1W1xwzBZPUbcUkkXDj45vC2s3Z8E+Lk7a3uZhvsQHLZnrfuWjBWGWvZ/MhZYgEXAMPLE"
}
)
}Content copied to clipboard
// This example creates a backend server authentication policy that enables authentication on your
// backend instance using a public key policy.
elasticLoadBalancingClient.createLoadBalancerPolicy {
loadBalancerName = "my-load-balancer"
policyName = "my-authentication-policy"
policyTypeName = "BackendServerAuthenticationPolicyType"
policyAttributes = listOf<PolicyAttribute>(
PolicyAttribute {
attributeName = "PublicKeyPolicyName"
attributeValue = "my-PublicKey-policy"
}
)
}Content copied to clipboard