使用Cloudformation的EC2错误:服务:AmazonEC2;状态码:400;错误代码:IncorrectInstanceState [英] EC2 Error using Cloudformation: Service: AmazonEC2; Status Code: 400; Error Code: IncorrectInstanceState

查看:378
本文介绍了使用Cloudformation的EC2错误:服务:AmazonEC2;状态码:400;错误代码:IncorrectInstanceState的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置一个R2可以用于R的EC2实例,因为我的计算机很烂。

I am trying to set up an EC2 instance that I can use for R since my computer sucks.

我正在使用云端模板,我在此帮助文章

I am using this cloudfront template which I found on this help article.

工作,但还不止于此。我尝试启动该实例并收到此消息:

It is so close to working, but not quite there. I tried to launch the instance and received this msg:



'eni-001a6e8290f522251待处理的接口放置实例对于此
操作,附加的附件'处于无效状态(服务:AmazonEC2;状态代码:400;错误代码:
IncorrectInstanceState;请求ID:
c372ab81-053d-4225-b6f4- b3edd2421296)

The pending-interface-placement instance to which 'eni-001a6e8290f522251' is attached is not in a valid state for this operation (Service: AmazonEC2; Status Code: 400; Error Code: IncorrectInstanceState; Request ID: c372ab81-053d-4225-b6f4-b3edd2421296)

默认的 ami_id 在第一次使用时不起作用,因此我将其替换为 ami-0cd3dfa4e37921605

The default ami_id didn't work on the first go, so I replaced it with ami-0cd3dfa4e37921605.

发生错误后,其余操作会回滚。 AWS帐户是没有任何其他设置的新帐户。我创建了一个VPC以及一个相关的子网和Internet网关以确保安全性,还创建了一个用于EC2和S3存储桶的密钥对。

After the error, the rest of the operation rolled back. The AWS account is a new account without any other settings. I created a VPC and an associated subnet and internet gateway for security, plus a key pair for EC2 and an S3 bucket.

推荐答案

您需要在cloudformation模板中进行更改。

You need to make a change in the cloudformation template.

查找本节

  RStatsEC2Instance:
Type: AWS::EC2::Instance
DependsOn: RStatsEIP
Properties:
  ImageId: !Ref ImageId
  InstanceType: !Ref InstanceType

此处您需要用RStatsEIPAssociation替换RStatsEIP

Here you need to replace RStatsEIP with RStatsEIPAssociation

这将确保在将弹性IP与网络接口相关联之后创建EC2实例。

This will ensure that the EC2 instance will be created after the elastic IP will be associated with the network interface.

上传yaml文件并继续。

Upload the yaml file and continue.

这篇关于使用Cloudformation的EC2错误:服务:AmazonEC2;状态码:400;错误代码:IncorrectInstanceState的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆