Open jeronimonunes opened 1 year ago
Hey,
Apologies for the delayed reply, but we've been busy the past weeks.
It sounds to me like you have not properly configured the environment for the new filesystem:
import static org.carlspring.cloud.storage.s3fs.S3Factory.ACCESS_KEY;
import static org.carlspring.cloud.storage.s3fs.S3Factory.SECRET_KEY;
Map<String, ?> env = ImmutableMap.<String, Object> builder().put(ACCESS_KEY, "access key")
.put(SECRET_KEY, "secret key")
.build();
FileSystems.newFileSystem(URI.create("s3:///"), env, Thread.currentThread().getContextClassLoader());
We currently do not support picking up the AWS
environment variables so if you've deployed this in an EC2 instance with STS then that would not work out of the box unfortunately. You could probably use this:
Map<String, ?> env = ImmutableMap.<String, Object> builder().put(ACCESS_KEY, System.getEnv('AWS_ACCESS_KEY_ID'))
.put(SECRET_KEY, System.getEnv('AWS_SECRET_ACCESS_KEY'))
.build();
It is in our TODO list to have this automatically picked up, but we simply don't have that much time to dig into it right now. We are open for PRs if you are interested in working on this feature. :)
Bug Description
Using STS library all requests turns out as 403
Steps To Reproduce
Expected Behavior
Requests are successfully authenticated
Environment
s3fs-nio
version: