public static AwsCredentialsProvider create(boolean isCloud,
                                                @Nullable String stsRegion,
                                                @Nullable String accessKey,
                                                @Nullable String secretKey,
                                                @Nullable String assumeRoleArn) {
        AwsCredentialsProvider awsCredentials = isCloud ? getCloudAwsCredentialsProvider(accessKey, secretKey) :
                getAwsCredentialsProvider(accessKey, secretKey);

        // Apply the Assume Role ARN Authorization if specified. All AWSCredentialsProviders support this.
        if (!isNullOrEmpty(assumeRoleArn) && !isNullOrEmpty(stsRegion)) {
            LOG.debug("Creating cross account assume role credentials");
            return buildStsCredentialsProvider(awsCredentials, stsRegion, assumeRoleArn, accessKey);
        }

        return awsCredentials;
    }
@Test
    public void testKeySecret() {
        final AwsCredentialsProvider awsCredentialsProvider = AWSAuthFactory.create(false, null, "key", "secret", null);
        assertThat(awsCredentialsProvider).isExactlyInstanceOf(StaticCredentialsProvider.class);
        assertThat("key").isEqualTo(awsCredentialsProvider.resolveCredentials().accessKeyId());
        assertThat("secret").isEqualTo(awsCredentialsProvider.resolveCredentials().secretAccessKey());
    }