@Override
    public void initialize(Map<String, Param> params) throws TikaConfigException {
        //params have already been set...ignore them
        AWSCredentialsProvider provider;
        if (credentialsProvider.equals("instance")) {
            provider = InstanceProfileCredentialsProvider.getInstance();
        } else if (credentialsProvider.equals("profile")) {
            provider = new ProfileCredentialsProvider(profile);
        } else if (credentialsProvider.equals("key_secret")) {
            provider = new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey));
        } else {
            throw new TikaConfigException("credentialsProvider must be set and " + "must be either 'instance', 'profile' or 'key_secret'");
        }

        ClientConfiguration clientConfig = new ClientConfiguration().withMaxConnections(maxConnections);
        try {
            AmazonS3ClientBuilder amazonS3ClientBuilder = AmazonS3ClientBuilder
                    .standard()
                    .withClientConfiguration(clientConfig)
                    .withCredentials(provider)
                    .withPathStyleAccessEnabled(pathStyleAccessEnabled);
            if (!StringUtils.isBlank(endpointConfigurationService)) {
                amazonS3ClientBuilder.setEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpointConfigurationService, region));
            } else {
                amazonS3ClientBuilder.withRegion(region);
            }
            s3Client = amazonS3ClientBuilder.build();
        } catch (AmazonClientException e) {
            throw new TikaConfigException("can't initialize s3 pipesiterator", e);
        }
    }
This initializes the s3 client. Note, we wrap S3's RuntimeExceptions,
e.g. AmazonClientException in a TikaConfigException.

@param params params to use for initialization
@throws TikaConfigException
tika-pipes/tika-pipes-iterators/tika-pipes-iterator-s3/src/main/java/org/apache/tika/pipes/pipesiterator/s3/S3PipesIterator.java