[Rt-commit] rt branch 5.0/add-region-to-ExternalStorage-AmazonS3 created. rt-5.0.4-228-g6e204cddec

BPS Git Server git at git.bestpractical.com
Mon Sep 25 22:01:04 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/add-region-to-ExternalStorage-AmazonS3 has been created
        at  6e204cddec31cb1b10e59dd73ebb7be7a17d0036 (commit)

- Log -----------------------------------------------------------------
commit 6e204cddec31cb1b10e59dd73ebb7be7a17d0036
Author: Brad Embree <brad at bestpractical.com>
Date:   Mon Sep 25 14:57:13 2023 -0700

    Update POD with Region example

diff --git a/lib/RT/ExternalStorage/AmazonS3.pm b/lib/RT/ExternalStorage/AmazonS3.pm
index 1c2a06513b..b8aa33ebe0 100644
--- a/lib/RT/ExternalStorage/AmazonS3.pm
+++ b/lib/RT/ExternalStorage/AmazonS3.pm
@@ -252,6 +252,20 @@ RT what bucket name to use in your F<RT_SiteConfig.pm> file:
 You may specify a C<Host> option in C<Set(%ExternalStorage, ...);> to connect
 to an endpoint other than L<Amazon::S3>'s default of C<s3.amazonaws.com>.
 
+=item 8.
+
+You may specify a C<Region> option in C<Set(%ExternalStorage, ...);> to
+use an S3 bucket in an AWS region other than the default region for your
+AWS account.
+
+    Set(%ExternalStorage,
+        Type            => 'AmazonS3',
+        AccessKeyId     => '...',
+        SecretAccessKey => '...',
+        Bucket          => '...',
+        Region          => 'us-east-1', # Put AWS region code between quotes
+    );
+
 =back
 
 =head2 Direct Linking

commit 03078096088097af1a5aa8621c2b61432d52e7e0
Author: Brad Embree <brad at bestpractical.com>
Date:   Sun Mar 5 15:33:16 2023 -0800

    Add region to Amazon::S3 params

diff --git a/lib/RT/ExternalStorage/AmazonS3.pm b/lib/RT/ExternalStorage/AmazonS3.pm
index 16371ef19b..1c2a06513b 100644
--- a/lib/RT/ExternalStorage/AmazonS3.pm
+++ b/lib/RT/ExternalStorage/AmazonS3.pm
@@ -102,7 +102,8 @@ sub Init {
         aws_secret_access_key => $self->SecretAccessKey,
         retry                 => 1,
     );
-    $args{host} = $self->{Host} if $self->{Host};
+    $args{host}   = $self->{Host} if $self->{Host};
+    $args{region} = $self->{Region} if $self->{Region};
 
     my $S3 = Amazon::S3->new(\%args);
     $self->S3($S3);

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list