setLoadBalancerPoliciesForBackendServer method
Replaces the set of policies associated with the specified port on which the EC2 instance is listening with a new set of policies. At this time, only the back-end server authentication policy type can be applied to the instance ports; this policy type is composed of multiple public key policies.
Each time you use SetLoadBalancerPoliciesForBackendServer
to
enable the policies, use the PolicyNames
parameter to list
the policies that you want to enable.
You can use DescribeLoadBalancers or DescribeLoadBalancerPolicies to verify that the policy is associated with the EC2 instance.
For more information about enabling back-end instance authentication, see Configure Back-end Instance Authentication in the Classic Load Balancers Guide. For more information about Proxy Protocol, see Configure Proxy Protocol Support in the Classic Load Balancers Guide.
May throw AccessPointNotFoundException. May throw PolicyNotFoundException. May throw InvalidConfigurationRequestException.
Parameter instancePort
:
The port number associated with the EC2 instance.
Parameter loadBalancerName
:
The name of the load balancer.
Parameter policyNames
:
The names of the policies. If the list is empty, then all current polices
are removed from the EC2 instance.
Implementation
Future<void> setLoadBalancerPoliciesForBackendServer({
required int instancePort,
required String loadBalancerName,
required List<String> policyNames,
}) async {
ArgumentError.checkNotNull(instancePort, 'instancePort');
ArgumentError.checkNotNull(loadBalancerName, 'loadBalancerName');
ArgumentError.checkNotNull(policyNames, 'policyNames');
final $request = <String, dynamic>{};
$request['InstancePort'] = instancePort;
$request['LoadBalancerName'] = loadBalancerName;
$request['PolicyNames'] = policyNames;
await _protocol.send(
$request,
action: 'SetLoadBalancerPoliciesForBackendServer',
version: '2012-06-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['SetLoadBalancerPoliciesForBackendServerInput'],
shapes: shapes,
resultWrapper: 'SetLoadBalancerPoliciesForBackendServerResult',
);
}