15
11

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 5 years have passed since last update.

LaravelでS3にファイルを送る際にIAMロールを使う場合の設定

Posted at

ファイルの保存先をローカルからS3にする時にとてもハマったので備忘メモ
検索の仕方が悪いのかもしれないけどACCESS_KEY_IDとSECRET_ACCESS_KEYを指定する方法しか出てこなかった

結論

filesystems.php

    's3' => [
        'driver' => 's3',
        'key'    => null,
        'secret' => null,
        'region' => env('AWS_REGION'),
        'bucket' => env('AWS_BUCKET'),
    ],

IAMロールをEC2のインスタンスに付与してアクセスを行う際はnullを設定する
項目自体をコメントアウトするとFWでエラーが出るので注意

15
11
2

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
15
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?