Spot Instance Request Error: MaxSpotInstanceCountExceeded

Hi there,

I am trying to create a spot instance request in AWS using the code block below, but I keep getting the error “MaxSpotInstanceCountExceeded” even though I can successfully create the same Spot Instance request using the AWS console.

Does anyone have any idea why it wont allow me to do the same using my Terraform script?

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"

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"
}

}