createLoadBalancerPolicy
inline suspend fun ElasticLoadBalancingClient.createLoadBalancerPolicy(crossinline block: CreateLoadBalancerPolicyRequest.Builder.() -> Unit): 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
import aws.sdk.kotlin.services.elasticloadbalancing.model.PolicyAttribute
fun main() {
//sampleStart
// 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"
}
)
}
//sampleEnd
}