3
2

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.

spring-cloud-aws入りのspringをlocalで動かすと怒られる

Posted at

The region can be automatically detected or explicitly configured

http://cloud.spring.io/spring-cloud-aws/spring-cloud-aws.html#_configuring_region

公式リファレンスにさらっと書いてあるわけですが、spring-cloud-awsはデフォルトで自身が動いているサーバーのregionを取得しようとします。もしAWS環境(EC2)内で立ち上がったものではないspringアプリケーションだった場合、regionを検出できなくて怒られ、起動に失敗します。

regionの検出についてはEC2のインスタンスメタデータを参考にしていただきたいのですが、つまりメタデータがそもそもない環境だから見に行こうとして死ぬわけですね。

local環境に限らずEC2以外で動かすには上記の節を参考に、

application.yml
cloud.aws.region.auto: false
cloud.aws.region.static: "${your_region}"

と、手動で設定してあげましょう。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?