in distribution-configuration/src/main/java/software/amazon/imagebuilder/distributionconfiguration/ReadHandler.java [39:66]
private ProgressEvent<ResourceModel, CallbackContext> fetchDistributionConfigurationAndAssertExists() {
final ResourceModel model = request.getDesiredResourceState();
if (model == null || model.getArn() == null) {
throwNotFoundException(model);
}
GetDistributionConfigurationResponse response = null;
try {
response = proxy.injectCredentialsAndInvokeV2(RequestUtil.generateGetDistributionConfigurationRequest(model),
ClientBuilder.getImageBuilderClient()::getDistributionConfiguration);
} catch (final ResourceNotFoundException e) {
throwNotFoundException(model);
} catch (final InvalidParameterException e) {
throw new CfnInvalidRequestException(ResourceModel.TYPE_NAME);
}
final ResourceModel modelFromReadResult = Translator.translateForRead(response);
if (modelFromReadResult.getArn() == null) {
throwNotFoundException(model);
}
return ProgressEvent.<ResourceModel, CallbackContext>builder()
.resourceModel(modelFromReadResult)
.status(OperationStatus.SUCCESS)
.build();
}