问题描述
我正在尝试设置一个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:
默认的 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!