File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/main/java/com/amigoscode/config Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 44import org .springframework .context .annotation .Bean ;
55import org .springframework .context .annotation .Configuration ;
66import software .amazon .awssdk .auth .credentials .AwsBasicCredentials ;
7+ import software .amazon .awssdk .auth .credentials .DefaultCredentialsProvider ;
78import software .amazon .awssdk .auth .credentials .ProfileCredentialsProvider ;
89import software .amazon .awssdk .auth .credentials .StaticCredentialsProvider ;
910import software .amazon .awssdk .regions .Region ;
@@ -43,12 +44,13 @@ public S3Client s3Client() {
4344 .pathStyleAccessEnabled (pathStyleEnabled )
4445 .build ());
4546
46- // Use MinIO credentials for local development, AWS profile for other environments
47+ // Use MinIO credentials for local development, default credentials chain for AWS
4748 if ("local" .equals (activeProfile )) {
4849 builder = builder .credentialsProvider (StaticCredentialsProvider .create (
4950 AwsBasicCredentials .create (accessKeyId , secretAccessKey )));
5051 } else {
51- builder = builder .credentialsProvider (ProfileCredentialsProvider .create ());
52+ // Use default credentials provider chain (IAM roles, env vars, profiles, etc.)
53+ builder = builder .credentialsProvider (DefaultCredentialsProvider .create ());
5254 }
5355
5456 if (StringUtils .isNotBlank (endpointOverride )) {
You can’t perform that action at this time.
0 commit comments