从ebextension脚本回显字符串 [英] Echo a string from ebextension script

查看:48
本文介绍了从ebextension脚本回显字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a Windows instance of aws Elastic Beanstalk. I want to echo a text from the script inside .ebextensions folder and be able to see it in the deployment logs. Here is what I have:

container_commands:
  0100_execute_only_in_dev:
    command: echo "The_man_in_the_high_castle" 

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

The deployment is successful but when I requested logs for the EC2 instance, there is no text echo'ed.

正确的方法是什么?

推荐答案

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%"

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

In the end, the above worked for me.

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

这篇关于从ebextension脚本回显字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆