setSecurityGroups method
Associates the specified security groups with the specified Application Load Balancer. The specified security groups override the previously associated security groups.
You can't specify a security group for a Network Load Balancer or Gateway Load Balancer.
May throw LoadBalancerNotFoundException. May throw InvalidConfigurationRequestException. May throw InvalidSecurityGroupException.
Parameter loadBalancerArn
:
The Amazon Resource Name (ARN) of the load balancer.
Parameter securityGroups
:
The IDs of the security groups.
Implementation
Future<SetSecurityGroupsOutput> setSecurityGroups({
required String loadBalancerArn,
required List<String> securityGroups,
}) async {
ArgumentError.checkNotNull(loadBalancerArn, 'loadBalancerArn');
ArgumentError.checkNotNull(securityGroups, 'securityGroups');
final $request = <String, dynamic>{};
$request['LoadBalancerArn'] = loadBalancerArn;
$request['SecurityGroups'] = securityGroups;
final $result = await _protocol.send(
$request,
action: 'SetSecurityGroups',
version: '2015-12-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['SetSecurityGroupsInput'],
shapes: shapes,
resultWrapper: 'SetSecurityGroupsResult',
);
return SetSecurityGroupsOutput.fromXml($result);
}