【发布时间】:2017-10-29 12:13:00
【问题描述】:
我有一个测试模板,它使用 cfn-init 和 AWS::CloudFormation::Authentication 和 AWS::CloudFormation::Init 部分从 S3 存储桶下载单个非公共文件。
这在 Amazon AMI 上成功运行,但在 Ubuntu AMI 上失败并出现以下错误:
警告 [2017-10-29 12:01:03,541] 无法检索远程元数据:没有凭据!
警告 [2017-10-29 12:01:03,541] 无法打开本地元数据:/var/cache/heat-cfntools/last_metadata
警告 [2017-10-29 12:01:03,542] 无法打开本地元数据:/var/lib/heat-cfntools/cfn-init-data
错误 [2017-10-29 12:01:03,542] 无法读取任何有效的元数据!
错误 [2017-10-29 12:01:03,542] 处理元数据时出错
回溯(最近一次通话最后):
文件“/usr/bin/cfn-init”,第 68 行,在
metadata.cfn_init()
cfn_init 中的文件“/usr/lib/python2.7/dist-packages/heat_cfntools/cfntools/cfn_helper.py”,第 1270 行
引发异常(“无效元数据”)
例外:无效的元数据
完整模板 - https://pastebin.com/e072d5GF。
我发现了一个类似的问题on Launchpad,但没有答案。
编辑:这是curl 169.254.169.254/latest/meta-data/iam/info/的输出:
{
"Code" : "InstanceProfileNotFound",
"Message" : "Instance Profile with Id AIPAJWC744OTCCS55JMTW cannot be found. Please see documentation at http://docs.amazonwebservices.com/IAM/latest/UserGuide/RolesTroubleshooting.html.",
"LastUpdated" : "2017-10-29T12:26:01Z"
}
【问题讨论】:
标签: amazon-web-services ubuntu amazon-s3 amazon-cloudformation