Skip to content

Commit

Permalink
[Drift Detection] Adding handler action for DbInstance and DbCluster.
Browse files Browse the repository at this point in the history
Adding Handler Action for DbInstance and DbCluster status in order to
differentiate between CREATE and UPDATE resource state.
  • Loading branch information
gabrixdu authored and dbbh committed Jul 2, 2024
1 parent cd9ed80 commit cd811bd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Map;
import java.util.function.Function;

import com.google.common.collect.ImmutableMap;
import lombok.NonNull;
import org.apache.commons.lang3.exception.ExceptionUtils;
import software.amazon.awssdk.core.exception.SdkClientException;
Expand Down Expand Up @@ -132,7 +133,7 @@ public static <M, C> ProgressEvent<M, C> reportResourceDrift(
final DriftDetector driftDetector = new DriftDetector(schema);
final Map<String, Mutation> mutations = driftDetector.detectDrift(inputModel, progress.getResourceModel());
if (!mutations.isEmpty()) {
requestLogger.log(String.format("Resource drift detected! Action: %s", handlerAction), new DriftDetectorReport(mutations));
requestLogger.log("Resource drift detected", ImmutableMap.of("HandlerAction", handlerAction, "Report", new DriftDetectorReport(mutations)));
}
} catch (Exception e) {
requestLogger.log("Drift detector internal error", e);
Expand Down

0 comments on commit cd811bd

Please sign in to comment.