disassociateHealthCheck method

Future<void> disassociateHealthCheck({
  1. required String healthCheckArn,
  2. required String protectionId,
})

Removes health-based detection from the Shield Advanced protection for a resource. Shield Advanced health-based detection uses the health of your AWS resource to improve responsiveness and accuracy in attack detection and mitigation.

You define the health check in Route 53 and then associate or disassociate it with your Shield Advanced protection. For more information, see Shield Advanced Health-Based Detection in the AWS WAF and AWS Shield Developer Guide.

May throw InternalErrorException. May throw InvalidParameterException. May throw ResourceNotFoundException. May throw OptimisticLockException.

Parameter healthCheckArn : The Amazon Resource Name (ARN) of the health check that is associated with the protection.

Parameter protectionId : The unique identifier (ID) for the Protection object to remove the health check association from.

Implementation

Future<void> disassociateHealthCheck({
  required String healthCheckArn,
  required String protectionId,
}) async {
  ArgumentError.checkNotNull(healthCheckArn, 'healthCheckArn');
  _s.validateStringLength(
    'healthCheckArn',
    healthCheckArn,
    1,
    2048,
    isRequired: true,
  );
  ArgumentError.checkNotNull(protectionId, 'protectionId');
  _s.validateStringLength(
    'protectionId',
    protectionId,
    1,
    36,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSShield_20160616.DisassociateHealthCheck'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'HealthCheckArn': healthCheckArn,
      'ProtectionId': protectionId,
    },
  );
}