imazen / imageflow-dotnet-server

A super-fast image server to speed up your site - deploy as a microservice, serverless, or embeddable.
https://docs.imageflow.io
GNU Affero General Public License v3.0
246 stars 33 forks source link

Update all dependent projects, docs, and examples to fix S3 startup delay #73

Open lilith opened 1 year ago

lilith commented 1 year ago

There's a bug in AWSSDK that can cause a 30 second startup delay if the "AWS_REGION=us-west-2" environment variable doesn't exist, despite the fact we provide that configuration in code.

lilith commented 1 year ago

Per https://github.com/aws/aws-sdk-net/issues/2546 the workaround is to specify DefaultConfigurationMode = DefaultConfigurationMode.Standard

services.AddAWSService<IAmazonS3>(new AWSOptions 
{
    Credentials = new AnonymousAWSCredentials(),
    Region = RegionEndpoint.USEast1,
    DefaultConfigurationMode = DefaultConfigurationMode.Standard
});