public <T> T build(final AwsClientBuilder builder, final Class<T> clientType) {
        val key = getSetting("credential-access-key");
        val secret = getSetting("credential-secret-key");
        val credentials = ChainingAWSCredentialsProvider.getInstance(key, secret);
        builder.credentialsProvider(credentials);

        val region = getSetting("region");
        builder.region(StringUtils.isBlank(region) ? Region.AWS_GLOBAL : Region.of(region));

        val endpoint = getSetting("endpoint");
        if (StringUtils.isNotBlank(endpoint)) {
            builder.endpointOverride(FunctionUtils.doUnchecked(() -> new URI(endpoint)));
        }
        val result = builder.build();
        return clientType.cast(result);
    }
Build the client.

@param <T>        the type parameter
@param builder    the builder
@param clientType the client type
@return the client instance
support/cas-server-support-aws/src/main/java/org/apereo/cas/aws/AmazonEnvironmentAwareClientBuilder.java