@Override
    public void initialize(Map<String, Param> params) throws TikaConfigException {
        if (!checkAvailable()) {
            return;
        }

        try {
            AwsBasicCredentials creds = AwsBasicCredentials.create(this.clientId, this.clientSecret);
            this.credsProvider = StaticCredentialsProvider.create(creds);
            if (region != null) {
                this.amazonS3 = S3Client.builder().credentialsProvider(credsProvider)
                        .region(Region.of(this.region)).build();
            } else {
                this.amazonS3 =
                        S3Client.builder().credentialsProvider(credsProvider).build();
                this.region = amazonS3.serviceClientConfiguration().region().id(); // not sure if this works at all
            }

            // for debugging
            StsClient stsClient = StsClient.builder()
                    .credentialsProvider(credsProvider).region(Region.of(region))
                    .build();
            GetCallerIdentityResponse identity = stsClient.getCallerIdentity(GetCallerIdentityRequest.builder()
                    .build());
            LOG.debug("Authenticated as: {}", identity.arn());

            if (!doesBucketExistV2(amazonS3, bucketName)) { // returns true if no access
                try {
                    amazonS3.createBucket(CreateBucketRequest.builder().bucket(this.bucketName)
                            .build());
                } catch (S3Exception e) {
                    throw new TikaConfigException("couldn't create bucket", e);
                }
            }
            this.amazonTranscribeAsync =
                    TranscribeAsyncClient.builder().credentialsProvider(credsProvider)
                            .region(Region.of(this.region)).build();
        } catch (Exception e) {
            LOG.warn("Exception reading config file", e);
            isAvailable = false;
        }

    }
Private helper function to get object from s3.

@param jobName The unique job name for each job(UUID).
@return TranscriptionJob object
tika-parsers/tika-parsers-ml/tika-transcribe-aws/src/main/java/org/apache/tika/parser/transcribe/aws/AmazonTranscribe.java