associateHealthCheck method
Adds health-based detection to 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 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 LimitsExceededException. May throw ResourceNotFoundException. May throw InvalidParameterException. May throw OptimisticLockException.
Parameter healthCheckArn
:
The Amazon Resource Name (ARN) of the health check to associate with the
protection.
Parameter protectionId
:
The unique identifier (ID) for the Protection object to add the
health check association to.
Implementation
Future<void> associateHealthCheck({
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.AssociateHealthCheck'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'HealthCheckArn': healthCheckArn,
'ProtectionId': protectionId,
},
);
}