modifyTargetGroup method

Future<ModifyTargetGroupOutput> modifyTargetGroup({
  1. required String targetGroupArn,
  2. bool? healthCheckEnabled,
  3. int? healthCheckIntervalSeconds,
  4. String? healthCheckPath,
  5. String? healthCheckPort,
  6. ProtocolEnum? healthCheckProtocol,
  7. int? healthCheckTimeoutSeconds,
  8. int? healthyThresholdCount,
  9. Matcher? matcher,
  10. int? unhealthyThresholdCount,
})

Modifies the health checks used when evaluating the health state of the targets in the specified target group.

May throw TargetGroupNotFoundException. May throw InvalidConfigurationRequestException.

Parameter targetGroupArn : The Amazon Resource Name (ARN) of the target group.

Parameter healthCheckEnabled : Indicates whether health checks are enabled.

Parameter healthCheckIntervalSeconds : The approximate amount of time, in seconds, between health checks of an individual target. For TCP health checks, the supported values are 10 or 30 seconds.

With Network Load Balancers, you can't modify this setting.

Parameter healthCheckPath : HTTP/HTTPS health checks The destination for health checks on the targets.

HTTP1 or HTTP2 protocol version The ping path. The default is /.

GRPC protocol version The path of a custom health check method with the format /package.service/method. The default is /AWS.ALB/healthcheck.

Parameter healthCheckPort : The port the load balancer uses when performing health checks on targets.

Parameter healthCheckProtocol : The protocol the load balancer uses when performing health checks on targets. The TCP protocol is supported for health checks only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The GENEVE, TLS, UDP, and TCP_UDP protocols are not supported for health checks.

With Network Load Balancers, you can't modify this setting.

Parameter healthCheckTimeoutSeconds : HTTP/HTTPS health checks The amount of time, in seconds, during which no response means a failed health check.

With Network Load Balancers, you can't modify this setting.

Parameter healthyThresholdCount : The number of consecutive health checks successes required before considering an unhealthy target healthy.

Parameter matcher : HTTP/HTTPS health checks The HTTP or gRPC codes to use when checking for a successful response from a target.

With Network Load Balancers, you can't modify this setting.

Parameter unhealthyThresholdCount : The number of consecutive health check failures required before considering the target unhealthy. For target groups with a protocol of TCP or TLS, this value must be the same as the healthy threshold count.

Implementation

Future<ModifyTargetGroupOutput> modifyTargetGroup({
  required String targetGroupArn,
  bool? healthCheckEnabled,
  int? healthCheckIntervalSeconds,
  String? healthCheckPath,
  String? healthCheckPort,
  ProtocolEnum? healthCheckProtocol,
  int? healthCheckTimeoutSeconds,
  int? healthyThresholdCount,
  Matcher? matcher,
  int? unhealthyThresholdCount,
}) async {
  ArgumentError.checkNotNull(targetGroupArn, 'targetGroupArn');
  _s.validateNumRange(
    'healthCheckIntervalSeconds',
    healthCheckIntervalSeconds,
    5,
    300,
  );
  _s.validateStringLength(
    'healthCheckPath',
    healthCheckPath,
    1,
    1024,
  );
  _s.validateNumRange(
    'healthCheckTimeoutSeconds',
    healthCheckTimeoutSeconds,
    2,
    120,
  );
  _s.validateNumRange(
    'healthyThresholdCount',
    healthyThresholdCount,
    2,
    10,
  );
  _s.validateNumRange(
    'unhealthyThresholdCount',
    unhealthyThresholdCount,
    2,
    10,
  );
  final $request = <String, dynamic>{};
  $request['TargetGroupArn'] = targetGroupArn;
  healthCheckEnabled?.also((arg) => $request['HealthCheckEnabled'] = arg);
  healthCheckIntervalSeconds
      ?.also((arg) => $request['HealthCheckIntervalSeconds'] = arg);
  healthCheckPath?.also((arg) => $request['HealthCheckPath'] = arg);
  healthCheckPort?.also((arg) => $request['HealthCheckPort'] = arg);
  healthCheckProtocol
      ?.also((arg) => $request['HealthCheckProtocol'] = arg.toValue());
  healthCheckTimeoutSeconds
      ?.also((arg) => $request['HealthCheckTimeoutSeconds'] = arg);
  healthyThresholdCount
      ?.also((arg) => $request['HealthyThresholdCount'] = arg);
  matcher?.also((arg) => $request['Matcher'] = arg);
  unhealthyThresholdCount
      ?.also((arg) => $request['UnhealthyThresholdCount'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'ModifyTargetGroup',
    version: '2015-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ModifyTargetGroupInput'],
    shapes: shapes,
    resultWrapper: 'ModifyTargetGroupResult',
  );
  return ModifyTargetGroupOutput.fromXml($result);
}