in aws-logs-destination/src/main/java/software/amazon/logs/destination/BaseHandlerStd.java [69:90]
protected ProgressEvent<ResourceModel, CallbackContext> putDestination(final AmazonWebServicesClientProxy proxy,
final CallbackContext callbackContext, final ProxyClient<CloudWatchLogsClient> proxyClient,
final ResourceModel model, final String callGraph, final Logger logger, Action handlerAction) {
return proxy.initiate(callGraph, proxyClient, model, callbackContext)
.translateToServiceRequest(Translator::translateToPutDestinationRequest)
.makeServiceCall((awsRequest, sdkProxyClient) -> {
PutDestinationResponse putDestinationResponse = null;
try {
putDestinationResponse = proxyClient.injectCredentialsAndInvokeV2(awsRequest,
proxyClient.client()::putDestination);
logger.log(String.format("%s resource with name %s has been successfully %s",
ResourceModel.TYPE_NAME, model.getDestinationName(), handlerAction.name()));
} catch (CloudWatchLogsException e) {
logger.log(String.format(
"Exception while invoking the putDestination API for the destination ID %s. %s ",
model.getDestinationName(), e));
Translator.translateException(e);
}
return putDestinationResponse;
})
.progress();
}