Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] debug InstanceProfileCredentialsProvider usage #397

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.apache.kafka.common.Configurable;
import org.slf4j.Logger;
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
import software.amazon.awssdk.auth.credentials.InstanceProfileCredentialsProvider;
import software.amazon.awssdk.profiles.ProfileFileSupplier;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.sts.StsClient;
Expand Down Expand Up @@ -82,9 +82,9 @@ public static AwsCredentialsProvider getAwsCredentialsProvider(EventBridgeSinkCo
return getStsAssumeRoleCredentialsProvider(config);
}

private static DefaultCredentialsProvider getDefaultCredentialsProvider(
private static InstanceProfileCredentialsProvider getDefaultCredentialsProvider(
EventBridgeSinkConfig config) {
var builder = DefaultCredentialsProvider.builder();
var builder = InstanceProfileCredentialsProvider.builder();

// Leverage DefaultSupplier to automatically reload credentials on file refresh
// https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-profiles.html#profile-reloading
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider;
Expand All @@ -24,6 +25,7 @@ public class EventBridgeCredentialsProviderFactoryTest {
"aws.eventbridge.eventbus.arn", "arn:aws:events:us-east-1:000000000000:event-bus/e2e");

@Test
@Disabled
public void shouldUseDefaultAwsCredentialsProvider() {

var provider =
Expand Down
Loading