From 419c53ec62de6e97a517abd5fdd4cbde3a942a34 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 19 Oct 2023 12:57:54 +0000 Subject: Add latest changes from gitlab-org/gitlab@16-5-stable-ee --- lib/aws/s3_client.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lib/aws/s3_client.rb (limited to 'lib/aws/s3_client.rb') diff --git a/lib/aws/s3_client.rb b/lib/aws/s3_client.rb new file mode 100644 index 00000000000..bdaea7efabf --- /dev/null +++ b/lib/aws/s3_client.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Aws + class S3Client + def initialize(access_key_id, secret_access_key, aws_region) + credentials = Aws::Credentials.new(access_key_id, secret_access_key) + @s3_client = Aws::S3::Client.new(region: aws_region, credentials: credentials) + end + + def upload_object(key, bucket, body, content_type = 'application/json') + @s3_client.put_object(key: key, bucket: bucket, body: body, content_type: content_type) + end + end +end -- cgit v1.2.3