From 44598bf72459e4a5e455af7ae447cb9b6d434546 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Tue, 4 Oct 2022 19:39:25 -0600 Subject: [PATCH] Support configuring storage class for S3 backup uploads (#4399) Closes --- .../Api/Remote/Backups/BackupRemoteUploadController.php | 5 +++++ config/backups.php | 2 ++ 2 files changed, 7 insertions(+) diff --git a/app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php b/app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php index 515003ac9..a1ffb81bc 100644 --- a/app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php +++ b/app/Http/Controllers/Api/Remote/Backups/BackupRemoteUploadController.php @@ -82,6 +82,11 @@ class BackupRemoteUploadController extends Controller 'ContentType' => 'application/x-gzip', ]; + $storageClass = config('backups.disks.s3.storage_class'); + if (!is_null($storageClass)) { + $params['StorageClass'] = $storageClass; + } + // Execute the CreateMultipartUpload request $result = $client->execute($client->getCommand('CreateMultipartUpload', $params)); diff --git a/config/backups.php b/config/backups.php index 3e6ecc6ec..f466ea4d5 100644 --- a/config/backups.php +++ b/config/backups.php @@ -59,6 +59,8 @@ return [ 'endpoint' => env('AWS_ENDPOINT'), 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 'use_accelerate_endpoint' => env('AWS_BACKUPS_USE_ACCELERATE', false), + + 'storage_class' => env('AWS_BACKUPS_STORAGE_CLASS'), ], ], ];