LoginSignup
7
2

More than 5 years have passed since last update.

localstackのS3にgolangからファイルをアップロードしてみる

Last updated at Posted at 2017-07-07

AWSのサービスをdocker上でなんとなく動かすという、localstack/localstack。S3にファイルアップロードの際に、設定が少し必要でした。

    s := session.Must(session.NewSession(&aws.Config{
        Credentials:      credentials.NewStaticCredentials("foo", "var", ""),
        S3ForcePathStyle: aws.Bool(true),     // ここ
        Region:           aws.String(endpoints.UsWest2RegionID),
        Endpoint:         aws.String("http://localhost:4572"), // ここ
    }))

いかにdocker上で動くものをアップしています。

7
2
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
7
2