gpt4 book ai didi

amazon-web-services - Windows AMI 的 AWS CloudFormation/var/log/cloud-init-output.log 等效项

转载 作者:行者123 更新时间:2023-12-04 08:05:30 24 4
gpt4 key购买 nike

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

"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/ 中的某个地方,还是某个地方的日志文件?

最佳答案

根据documentation你必须包裹UserData<script></script> 。日志写入 C:\LogsC:\Log取决于是否EC2LaunchEC2Config已使用。

根据同一文档,默认情况下这应该适用于所有 Windows 实例,除非您明确使用 EC2Config .

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.

更多信息请访问 another question .

关于amazon-web-services - Windows AMI 的 AWS CloudFormation/var/log/cloud-init-output.log 等效项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46358862/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com