0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

aws-sdk-s3でROLEを使って操作する

Last updated at Posted at 2023-04-11

備忘録。

EC2でIAM-ROLEを利用している場合

credential = Aws::InstanceProfileCredentials.new
client = Aws::S3::Client.new(region: 'ap-northeast-1', credentials: credential)

ECSでTaskRoleを利用してる場合

credential = Aws::ECSCredentials.new(retries: 3)
client = Aws::S3::Client.new(region: 'ap-northeast-1', credentials: credential)

※retriesは指定した方がよい。metadataの情報を元にAPIをコールするため、データ取得に失敗する可能性があるため

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?