问题
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"
The deployment is successful but when I requested logs for the EC2 instance, there is no text echo'ed.
What is the correct way?
回答1:
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.
This answer https://stackoverflow.com/a/37189606/192727 helped a lot
来源:https://stackoverflow.com/questions/59094560/echo-a-string-from-ebextension-script