Amazon ec2 地形:无法创建spot实例。错误:超出MaxSpotInstanceCount
我正在尝试在Terraform中创建一个spot实例,Terraform代码看起来很好,但我不断收到一个错误,说MaxSpotInstanceCountOversed 注意:现在这只是一个测试,因此我不包括安全组、IP等 我已采取的步骤:Amazon ec2 地形:无法创建spot实例。错误:超出MaxSpotInstanceCount,amazon-ec2,terraform,aws-cli,terraform-provider-aws,amazon-ec2-spot-market,Amazon Ec2,Terraform,Aws Cli,Terraform Provider Aws,Amazon Ec2 Spot Market,我正在尝试在Terraform中创建一个spot实例,Terraform代码看起来很好,但我不断收到一个错误,说MaxSpotInstanceCountOversed 注意:现在这只是一个测试,因此我不包括安全组、IP等 我已采取的步骤: 已检查是否在控制台中创建了0个spot实例请求 尝试登录控制台并创建spot实例请求。它很好用 已取消spot实例请求,以确保我现在有0个spot实例请求 现在,我尝试使用下面的terraform脚本创建几乎相同的spot实例,但我得到了错误:MaxSpotI
provider "aws" {
profile = "terraform_enterprise_user"
region = "us-east-2"
}
resource "aws_spot_instance_request" "MySpotInstance" {
# Spot Request Settings
wait_for_fulfillment = "true"
spot_type = "persistent"
instance_interruption_behaviour = "stop"
# Instance Settings
ami = "ami-0520e698dd500b1d1"
instance_type = "c4.large"
associate_public_ip_address = "1"
root_block_device {
volume_size = "10"
volume_type = "standard"
}
ebs_block_device {
device_name = "/dev/sdb"
volume_size = "50"
volume_type = "standard"
delete_on_termination = "true"
}
tags = {
Name = "MySpotInstance"
Application = "MyApp"
Environment = "TEST"
}
}
这回答了你的问题吗?有时,AZ可能会用完特定的EC2实例类,来自Terraform的错误消息可能不会反映它。这个问题在花了几个小时后是否一直发生?它是否发生在c4以外的其他实例类型上。大型?运行脚本并在俄亥俄州的AZ-a创建RHEL-8.0.0_HVM-20190618-x86_64-1-Hourly2-GP2(ami-0520e698dd500b1d1)。所以代码不是问题所在。请尝试从控制台创建相同的spot实例?