从ebextension脚本回显字符串

时间:2019-11-28 18:24:59

标签: amazon-web-services amazon-elastic-beanstalk

我有一个AWS Elastic Beanstalk的Windows实例。我想从.ebextensions文件夹中的脚本中回显文本,并能够在部署日志中看到它。这是我所拥有的:

container_commands:
  0100_execute_only_in_dev:
    command: echo "The_man_in_the_high_castle" 

部署成功,但是当我请求EC2实例的日志时,没有文本回显。

正确的方法是什么?

1 个答案:

答案 0 :(得分:0)

files:
  "C:\\Program Files\\Amazon\\ElasticBeanstalk\\config\\taillogs.d\\cfn-init-cmd.conf" :
    content: |
      c:\cfn\log\cfn-init-cmd.log
container_commands:
  0109_cmd:
    command: "echo show this: %My_Env%"

最后,以上内容对我有用。

这个答案https://stackoverflow.com/a/37189606/192727很有帮助