diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 15:57:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 15:57:54 +0300 |
commit | 419c53ec62de6e97a517abd5fdd4cbde3a942a34 (patch) | |
tree | 1f43a548b46bca8a5fb8fe0c31cef1883d49c5b6 /lib/aws/s3_client.rb | |
parent | 1da20d9135b3ad9e75e65b028bffc921aaf8deb7 (diff) |
Add latest changes from gitlab-org/gitlab@16-5-stable-eev16.5.0-rc42
Diffstat (limited to 'lib/aws/s3_client.rb')
-rw-r--r-- | lib/aws/s3_client.rb | 14 |
1 files changed, 14 insertions, 0 deletions
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 |