Lucee S3 Extension Version 2.0 (Beta)

There is a new version of the S3 Extension https://ext.lucee.org/s3-extension-2.0.0.0-BETA.lex that now allows to configure multiple endpoints to connect.
Please also see https://lucee.daemonite.io/t/s3-credentials/8580

So far
Next to default credentials in the Application.cfc like this

this.s3.accessKeyId = "...";
this.s3.awsSecretKey = "...";

that you can use like this in the code

dump(directoryList("s3:///"));

New
you now can define credentials also like this in the Application.cfc

// extension provider endpoint
this.vfs.s3.extensionProvider.accessKeyId = "...";
this.vfs.s3.extensionProvider.awsSecretKey = "...";

// general artifacts
this.vfs.s3.artifacts.accessKeyId = "...";
this.vfs.s3.artifacts.awsSecretKey = "...";

// vfs=virtual file system

that then can be used like this in the code

dump(directoryList("s3://extensionProvider@/"));
dump(directoryList("s3://artifacts@/"));

Next to the Application.cfc, you can also define this endpoints in environment variables like this

LUCEE_VFS_S3_EXTENSIONPROVIDER_ACCESSKEYID =...
LUCEE_VFS_S3_EXTENSIONPROVIDER_SECRETKEY =...
LUCEE_VFS_S3_ARTIFACTS_ACCESSKEYID =...
LUCEE_VFS_S3_ARTIFACTS_SECRETKEY =...

or with system properties like this

-Dlucee.vfs.s3.extensionprovider.accesskeyid=...
-Dlucee.vfs.s3.extensionprovider.secretkey=...
-Dlucee.vfs.s3.artifacts.accesskeyid=...
-Dlucee.vfs.s3.artifacts.secretkey=...

This extension will be bundled with Lucee 6, but of course can also be used with Lucee 5.

BTW we use “vfs” as part of the structure because we plan to add more possible settings for other virtual file system in the near future and we wanna have a common structure for all this VFS settings. And yes you can also do this.vfs.s3.accessKeyId as an alias for this.s3.accessKeyId.

2 Likes

Will this extension ever support the ability to use any other S3 Vendors? If it can, I have not seen anything that demonstrates how to set the endpoint.

pass in their host name?

-Dlucee.vfs.s3.artifacts.host=...

1 Like

Not sure I am understanding how that works. If I want to use the s3 extension to upload to different providers, I have to set a -D option on the server at runtime?

I guess I am not quite understanding how that would/should work. It seems at the point I am passing my access_key and secrect_key I should be passing in the endpoint too.

the s3 resource url format is s3://#access#:#secret#@#host#/#bucketname#

host is often left out (which then defaults to aws)

i.e. s3://#access#:#secret#@/#bucketname#

What is the difference between s3://extensionProvider@/ and s3://artifacts@/ ?

This is really good information and should be pushlished. i will test this.