我很难让cfn-init在Windows上工作。
我这样做:
cfn-init.exe -v -c config
-s arn:aws:cloudformation:eu-north-1:894422057177:stack/Providence-Core-A47K89HAVG6V/20f830c0-05cd-12ea-9527-06c34fc32621
-r MyHost
--region eu-north-1
(为清楚起见添加了换行符)
并得到结果:
('Connection aborted.', error(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))
什么原因导致此错误?什么是无法达到的? (这不是我见过的最详细的错误消息:-))
cfn-init.exe
确实在尝试访问网络上的某些内容吗?如果是这样,目标地址是什么?
对于网络ACL和SecurityGroup,我的出站规则都非常严格。他们没有http / https的常规出站访问权限。那是原因吗?
答案 0 :(得分:1)
底线:是的,cfn-init
命令确实发出了出站https请求。您的SecurityGroup,子网ACL等必须允许此操作。
cfn-init
命令尝试从公共互联网上的AWS CloudFormation endpoint下载相关的CloudFormation堆栈。因此,如果使用cfn-init功能,则EC2实例必须对此类端点具有出站访问权限。
如果您不想为您的EC2实例授予通用出站访问权限,那么Amazon提供了VPC Endpoint for the AWS CloudFormation service。