Skip to content

Commit

Permalink
pass credentials to SQS if they exist
Browse files Browse the repository at this point in the history
  • Loading branch information
bkiahstroud committed Jul 24, 2024
1 parent d44d31c commit 46794ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion bin/migrate_iaids
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash
set -e

STAGE_ENV=production docker compose run --volume /store/tmp/fast-tmp:/store/tmp/fast-tmp web 'bundle exec bin/ia_to_s3_migrator'
STAGE_ENV=production docker compose run \
--rm \
--remove-orphans \
--volume /store/tmp/fast-tmp:/store/tmp/fast-tmp \
web \
'bundle exec bin/ia_to_s3_migrator'
6 changes: 5 additions & 1 deletion lib/space_stone/sqs_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ module SpaceStone
# Service object to add messages to either sqs queue
module SqsService
def client
@client ||= Aws::SQS::Client.new(region: 'us-east-2')
@client ||= if ENV.fetch('AWS_S3_ACCESS_KEY_ID', nil)
Aws::SQS::Client.new(region: 'us-east-2', credentials: Aws::Credentials.new(ENV.fetch('AWS_S3_ACCESS_KEY_ID'), ENV.fetch('AWS_S3_SECRET_ACCESS_KEY')))
else
Aws::SQS::Client.new(region: 'us-east-2')
end
end

def ocr_queue_url
Expand Down

0 comments on commit 46794ce

Please sign in to comment.