abashev / vfs-s3

Amazon S3 driver for Apache commons-vfs (Virtual File System) project
Apache License 2.0
93 stars 50 forks source link

Support Amazon IAM roles for authentication #31

Closed mdicesare closed 9 years ago

mdicesare commented 9 years ago

Amazon recommends accessing S3 through IAM roles instead of specifying AWS access key and secret id. The blog post below has a good summary of how to do this.

http://blogs.aws.amazon.com/security/post/Tx1XG3FX6VMU6O5/A-safer-way-to-distribute-AWS-credentials-to-EC2

For backwards comparability I suppose if credentials are provided they would be used as-is today otherwise this constructor could be used instead if no credentials are specified:

http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/AmazonS3Client.html#AmazonS3Client(com.amazonaws.ClientConfiguration)

S3FileSystemConfigBuilder.getInstance().getAWSCredentials(fsOptions) currently fails if access key or secret key are empty. As well S3FileProvider.doCreateFileSystem(...) would need to call the appropriate AmazonS3Client constructor depending on if AWSCredentials are specified by the user or not.

abashev commented 9 years ago

Fixed in 2.3.2