in infrastructure-configuration/src/main/java/software/amazon/imagebuilder/infrastructureconfiguration/ReadHandler.java [39:66]
private ProgressEvent<ResourceModel, CallbackContext> fetchInfrastructureConfigurationAndAssertExists() {
final ResourceModel model = request.getDesiredResourceState();
if (model == null || model.getArn() == null) {
throwNotFoundException(model);
}
GetInfrastructureConfigurationResponse response = null;
try {
response = proxy.injectCredentialsAndInvokeV2(RequestUtil.generateGetInfrastructureConfigurationRequest(model),
ClientBuilder.getImageBuilderClient()::getInfrastructureConfiguration);
} 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();
}