bootstrapping - cfn-init 无法在使用 Cloud Formation 的 VPC 中工作

标签 bootstrapping aws-cloudformation amazon-vpc

这是我第一次尝试使用 VPC。

我刚刚更改了模板以使用 VPC。当堆栈在 VPC 外部启动时一切都很好,但现在它们位于 VPC 内部,我无法在使用 cfn-init (Ec2Config) 包启动实例期间从 S3 下载文件。它是一个 Windows 盒子。

我在 cfn-init 日志中看到以下日志:

2012-10-11 08:11:40,992 DEBUG Client initialized with endpoint https://cloudformation.us-east-1.amazonaws.com  
2012-10-11 08:11:41,523 DEBUG Describing resource LaunchConfigName in stack StackName  
2012-10-11 08:12:03,113 ERROR URLError: getaddrinfo returns an empty list  
2012-10-11 08:12:03,144 DEBUG Sleeping for 0.921699 seconds before retrying  
2012-10-11 08:12:25,109 ERROR URLError: getaddrinfo returns an empty list  
2012-10-11 08:12:25,109 DEBUG Sleeping for 1.240427 seconds before retrying  
2012-10-11 08:12:47,386 ERROR URLError: getaddrinfo returns an empty list  
2012-10-11 08:12:47,386 DEBUG Sleeping for 5.528233 seconds before retrying  
2012-10-11 08:13:13,968 ERROR URLError: getaddrinfo returns an empty list  
2012-10-11 08:13:13,968 DEBUG Sleeping for 4.688940 seconds before retrying  
2012-10-11 08:13:39,677 ERROR URLError: getaddrinfo returns an empty list  

我在 cfn-hup 日志中看到以下日志:

2012-10-11 08:23:06,550 ERROR Error: could not find main configuation at C:\cfn\cfn-hup.conf  
2012-10-11 08:23:06,893 ERROR Error: main section must contain stack option  
2012-10-11 08:33:06,089 ERROR Error: could not find main configuation at C:\cfn\cfn-hup.conf  
2012-10-11 08:33:06,370 ERROR Error: main section must contain stack option  
2012-10-11 08:43:06,533 ERROR Error: could not find main configuation at C:\cfn\cfn-hup.conf  
2012-10-11 08:43:06,876 ERROR Error: main section must contain stack option  
2012-10-11 08:53:06,119 ERROR Error: could not find main configuation at C:\cfn\cfn-hup.conf  
2012-10-11 08:53:06,416 ERROR Error: main section must contain stack option  

从该实例中,我可以通过网络浏览器访问互联网。

最佳答案

您需要设置 NAT 服务器或为盒子分配弹性 IP 地址,否则盒子无法与互联网通信。

关于bootstrapping - cfn-init 无法在使用 Cloud Formation 的 VPC 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12842963/

相关文章:

assembly - 如何在 AT&T 程序集中正确定位变量?

intellij-idea - 如何在 IntelliJ IDE 中添加 Bootstrap 自动代码完成功能?

amazon-web-services - Cloudfront 与 cloudformation:AWS::CloudFront::Distribution:您的请求包含一个或多个无效位置代码

python - AWS 路由表导出详细信息到 CSV

java - Java Bootstrap 类加载器是如何加载的?

compiler-construction - 用自己的语言编写编译器

amazon-web-services - AWS CloudFormation,引用标签中的参数

amazon-web-services - 更新 CloudFormation 堆栈时,堆栈中存储的任何代码或数据会发生什么情况?

networking - EC2 VPC 实例 - 端口被过滤

amazon-web-services - 云形成: How to get VPC from Subnet Id