modifyListener method
- required String listenerArn,
- List<
String> ? alpnPolicy, - List<
Certificate> ? certificates, - List<
Action> ? defaultActions, - int? port,
- ProtocolEnum? protocol,
- String? sslPolicy,
Replaces the specified properties of the specified listener. Any properties that you do not specify remain unchanged.
Changing the protocol from HTTPS to HTTP, or from TLS to TCP, removes the security policy and default certificate properties. If you change the protocol from HTTP to HTTPS, or from TCP to TLS, you must add the security policy and default certificate properties.
To add an item to a list, remove an item from a list, or update an item in a list, you must provide the entire list. For example, to add an action, specify a list with the current actions plus the new action.
May throw DuplicateListenerException. May throw TooManyListenersException. May throw TooManyCertificatesException. May throw ListenerNotFoundException. May throw TargetGroupNotFoundException. May throw TargetGroupAssociationLimitException. May throw IncompatibleProtocolsException. May throw SSLPolicyNotFoundException. May throw CertificateNotFoundException. May throw InvalidConfigurationRequestException. May throw UnsupportedProtocolException. May throw TooManyRegistrationsForTargetIdException. May throw TooManyTargetsException. May throw TooManyActionsException. May throw InvalidLoadBalancerActionException. May throw TooManyUniqueTargetGroupsPerLoadBalancerException. May throw ALPNPolicyNotSupportedException.
Parameter listenerArn
:
The Amazon Resource Name (ARN) of the listener.
Parameter alpnPolicy
:
TLS listeners
The name of the Application-Layer Protocol Negotiation
(ALPN) policy. You can specify one policy name. The following are the
possible values:
-
HTTP1Only
-
HTTP2Only
-
HTTP2Optional
-
HTTP2Preferred
-
None
Parameter certificates
:
HTTPS and TLS listeners
The default certificate for the listener. You
must provide exactly one certificate. Set CertificateArn
to
the certificate ARN but do not set IsDefault
.
Parameter defaultActions
:
The actions for the default rule.
Parameter port
:
The port for connections from clients to the load balancer. You cannot
specify a port for a Gateway Load Balancer.
Parameter protocol
:
The protocol for connections from clients to the load balancer.
Application Load Balancers support the HTTP and HTTPS protocols. Network
Load Balancers support the TCP, TLS, UDP, and TCP_UDP protocols. You can’t
change the protocol to UDP or TCP_UDP if dual-stack mode is enabled. You
cannot specify a protocol for a Gateway Load Balancer.
Parameter sslPolicy
:
HTTPS and TLS listeners
The security policy that defines which protocols
and ciphers are supported.
For more information, see Security policies in the Application Load Balancers Guide or Security policies in the Network Load Balancers Guide.
Implementation
Future<ModifyListenerOutput> modifyListener({
required String listenerArn,
List<String>? alpnPolicy,
List<Certificate>? certificates,
List<Action>? defaultActions,
int? port,
ProtocolEnum? protocol,
String? sslPolicy,
}) async {
ArgumentError.checkNotNull(listenerArn, 'listenerArn');
_s.validateNumRange(
'port',
port,
1,
65535,
);
final $request = <String, dynamic>{};
$request['ListenerArn'] = listenerArn;
alpnPolicy?.also((arg) => $request['AlpnPolicy'] = arg);
certificates?.also((arg) => $request['Certificates'] = arg);
defaultActions?.also((arg) => $request['DefaultActions'] = arg);
port?.also((arg) => $request['Port'] = arg);
protocol?.also((arg) => $request['Protocol'] = arg.toValue());
sslPolicy?.also((arg) => $request['SslPolicy'] = arg);
final $result = await _protocol.send(
$request,
action: 'ModifyListener',
version: '2015-12-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['ModifyListenerInput'],
shapes: shapes,
resultWrapper: 'ModifyListenerResult',
);
return ModifyListenerOutput.fromXml($result);
}