如何检查我传递给 EC2 实例的用户数据是否有效? [英] How to check whether my user data passing to EC2 instance working or not?
本文介绍了如何检查我传递给 EC2 实例的用户数据是否有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在使用 EC2 命令行 API 创建新的 AWS EC2 实例时,我将一些用户数据传递给新实例.
While creating new AWS EC2 instance using EC2 command line API, i am passing some user data to new instance.
现在我是如何知道用户数据是否被执行的?
Now how i came to know whether that user data executed or not ?
我应该如何检查?
推荐答案
您可以使用以下步骤进行验证
You can verify using following steps
- 启动 EC2 实例时的 SSH
- 检查您的用户数据脚本的日志
/var/log/cloud-init.log
和/var/log/cloud-init-output.log
你可以看到你的用户数据脚本的所有日志,它还会创建/etc/cloud
文件夹.
You can see all log's of your user data script and it will also create /etc/cloud
folder.
这篇关于如何检查我传递给 EC2 实例的用户数据是否有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文