适用于Windows AMI的AWS CloudFormation/var/log/cloud-init-output.log [英] AWS CloudFormation /var/log/cloud-init-output.log equivalent for Windows AMIs

查看:75
本文介绍了适用于Windows AMI的AWS CloudFormation/var/log/cloud-init-output.log的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用CloudFormation在AWS中创建Linux AMI时,我可以查看Cloud Init脚本的输出,例如,如果我有一个呼应stdout的UserData部分:

When creating a Linux AMI in AWS with CloudFormation, I can view the output of the Cloud Init scripts, for example if I have a UserData section that echoes to stdout:

"UserData": {
    "Fn::Base64": {
        "Fn::Join": [
            "",
            [
                "#!/bin/bash -xe\n",
                "echo hello, stdout\n"
            ]
        ]
    }
}

然后/var/log/cloud-init-output.log将包含以下行:

+ echo hello, stdout
hello, stdout

Windows AMI的等效日志文件是什么?是http://169.254.169.254/中的某个地方,还是日志文件中的某个地方?

What is the equivalent log file for Windows AMIs? Is it somewhere in http://169.254.169.254/, or is it a log file somewhere?

推荐答案

根据

According to the documentation you have to wrap UserData with <script></script>. The log is written to either C:\Logs or C:\Log depending on whether EC2Launch or EC2Config is used.

根据同一文档,除非您明确使用

According to the same document, this should work on all Windows instances by default unless you expressly use EC2Config.

默认情况下,所有Amazon AMI均已为以下用户启用了用户数据执行: 初始启动.对于使用EC2Config服务的实例,您可以 指定必须在下次启动或重新启动时执行用户数据 服务.有关更多信息,请参阅Ec2服务属性.

By default, all Amazon AMIs have user data execution enabled for the initial boot. For instances using the EC2Config service, you can specify that user data must be executed on the next boot or restart of the service. For more information, see Ec2 Service Properties.

另一个问题上提供了更多信息.

这篇关于适用于Windows AMI的AWS CloudFormation/var/log/cloud-init-output.log的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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