public static DescribeConnectionResponse readResource()

in aws-events-connection/src/main/java/software/amazon/events/connection/Utils.java [18:30]


    public static DescribeConnectionResponse readResource(DescribeConnectionRequest awsRequest, ProxyClient<EventBridgeClient> proxyClient) {
        DescribeConnectionResponse awsResponse;
        try {
            awsResponse = proxyClient.injectCredentialsAndInvokeV2(awsRequest, proxyClient.client()::describeConnection);
        } catch (final ResourceNotFoundException e) {
            // connection does not exist
            throw new CfnNotFoundException(e);
        } catch (final AwsServiceException e) {
            throw new CfnGeneralServiceException(ResourceModel.TYPE_NAME, e);
        }

        return awsResponse;
    }