Elastic Beanstalk: How would I run an ebextension command on the worker tier only?

此生再无相见时 提交于 2019-12-01 05:16:13
Frank
  • Set an Environment Property like "tier=worker". Elastic Beanstalk --> Application --> Environment --> Configuration --> Software Configuration.
  • Use the "test" attribute of the "command" key to test for this property, so the command only get executed when the environment property is set.

Sample from the AWS doc:

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html

commands:
  python_install: 
    command: myscript.py
    cwd: /home/ec2-user
    env: 
      myvarname: myvarvalue
    test: '[ ! /usr/bin/python ] && echo "python not installed"'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!