0
0

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.

Elastic Beanstalk 特定環境の全インスタンス上でコマンドを実行する方法

Last updated at Posted at 2018-09-10

結論

aws elasticbeanstalk describe-instances-health --environment-name my-app | jq -r ".InstanceHealthList[].InstanceId" | xargs -I {} eb ssh --instance {} --command pwd

上記を実行すると、my-app 環境にある全インスタンスで pwd コマンドが実行されます。

必要なもの

  • awscli
    • pip install --user awscli
    • aws config
      • トークンとシークレットを入力
  • ebcli
    • pip install --user ebcli
    • eb ssh を実行できるようにする
      • eb init や鍵のセットアップなどをした気がするが、覚えていない・・・
  • jq
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?