Cfdirectory tag only supports specific regions while using S3

why does cfdirecotry tag support specific regions while using S3
it can only be EU, US or US-West
Why I cannot set other location as storelocation?
This need to be fix at following area

Those aren’t even valid AWS region names e.g. eu-west-1

I don’t know how or where this code is called though, can your elaborate ?

Not sure what happened to my previous post - but anyway…

I have started having a crack at this;
Updating the AWS regions - and have a question;
The following code is a portion for improveStorage() - but just for us-east-1

Am I reading the existing code / altering it correctly?
In that the ifs are possible versions someone “might” use?
Couldn’t we just use “the” list of regions and have coders use the “exact” match?

if ("us".equals(storage)) return "us-east-1";
		if ("us east".equals(storage)) return "us-east-1";
		if ("us-east".equals(storage)) return "us-east-1";
		if ("us-east-1".equals(storage)) return "us-east-1";
		if ("us east 1".equals(storage)) return "us-east-1";
		if ("us-east 1".equals(storage)) return "us-east-1";
		if ("n. virginia".equals(storage)) return "us-east-1";
		if ("n virginia".equals(storage)) return "us-east-1";
		if ("us east n. virginia".equals(storage)) return "us-east-1";
		if ("us east n virginia".equals(storage)) return "us-east-1";
		if ("virginia".equals(storage)) return "us-east-1";
		if ("usa".equals(storage)) return "us-east-1";
		if ("u.s.".equals(storage)) return "us-east-1";
		if ("u.s.a.".equals(storage)) return "us-east-1";
		if ("united states of america".equals(storage)) return "us-east-1";

At this rate I might get through all 25 of them (AWS Regions) - by the time I am 100!

  • us-east-1
  • us-east-2
  • us-west-1
  • us-west-2
  • af-south-1
  • ap-east-1
  • ap-southeast-1
  • ap-southeast-2
  • ap-southeast-3
  • ap-south-1
  • ap-northeast-1
  • ap-northeast-2
  • ap-northeast-3
  • ca-central-1
  • eu-central-1
  • eu-west-1
  • eu-west-2
  • eu-south-1
  • eu-west-3
  • eu-north-1
  • me-south-1
  • me-central-1
  • sa-east-1
  • us-gov-east-1
  • us-gov-west-1

In the issue LDEV-4178
I agreed with @Zackster - that we should remove the AWS helper from the directory() function.
There are currently 25 AWS regions.
It will take considerable effort to add “English” helpers for each of the 25 - And to maintain them.

If AWS changes anything - you have to update again…

And then, what about all the other “storage” providers?

While it is nice to be nice… we should just pass through the arguments provided.

1 Like

yes we should pass through the argument and then check if it is according to the requirement of the provider
We cannot do hard code many regions

I added some more cases to Lucee Development - Issues - Lucee where fileExists() with S3 paths seems to be broken to

I think the best approach is just to look for the standard environment variables e.g. AWS_REGION and use if present, allow override in the application.s3 struct and/or take it from the custom end point provided ?

I expected one of those to work at present, and at least in v5.4 it doesn’t.

can you file separate bugs about the problems you found

  • this.s3.defaultLocation
  • the file exists problems

we really want to avoid cross topic posting and discussion in tickets, sure it’s somewhat related but it’s very confusing, as you could see the focus there was the cfdirectory tag from the first few comments

once you’ve created those new tickets, I am going to delete those comments ok?

otherwise it’s really hard to follow tickets

I’ve created a new epic to track all the various issues we have with s3 region support, both with AWS and also with other providers [LDEV-4636] - Lucee

Sorry, didn’t think it was all separate things as it looked like a general problem with failing to pass region correctly down in to the S3 resource

1 Like

been hacking away, LDEV-4178 Support passthru of storage locations for Directory* functions / CFDIRECTORY is in QA, give it a test?

Available in the latest snapshots, and

1 Like

As soon as those make it to Docker Hub I can see what changes here.

let me check why that fails

regions with no aws providers, are still broken

automated docker builds aren’t working just yet, I just kicked off manually

1 Like