Even though the new Lucee S3 extension is built using the AWS Java SDK for S3, the standard configuration properties for the SDK are not picked up by the extension. We have quite a bit of our own code that uses the Java SDK directly and we just use environment variables to configure that and then have a simple createObject("java", "software.amazon.awssdk.services.s3.S3Client").builder().build();
to create the S3 client. That client then respects the standard AWS environment variables such as:
AWS_ACCOUNT_ID='000000000000'
AWS_ACCESS_KEY_ID='test'
AWS_SECRET_ACCESS_KEY='test'
AWS_REGION='eu-central-1'
AWS_ENDPOINT_URL'=http://localhost.localstack.cloud:4566'
AWS_ENDPOINT_URL_S3='http://s3.localhost.localstack.cloud:4566'
AWS_SDK_UA_APP_ID='my-app'
With the new S3 extension being based on the AWS Java SDK for S3 I was hoping that I would be able to fully configure all the credentials, endpoints etc from the Java environment as well and wouldn’t have to do a configuration specific to Lucee anymore. But it looks like these variables are not picked up and for instance with the configuration above this would still connect to AWS despite being configured for a local endpoint, unless I also add the LUCEE_S3_HOST
environment variable.
I would like s3://mybucket/#key#
to just work without any other configuration, based purely on the environment variables we have for the Java SDKs anyway. Most important of those would be that I would like it to also pick up the default credentials provider chain, so it looks for the role that has been configured on the container and uses the provisoned credentials for that.