Terraform: aws: Return user-friendly errors when creating EC2 spot request

Created on 15 Aug 2016  ยท  2Comments  ยท  Source: hashicorp/terraform

Terraform Version

Terraform v0.7.1-dev (5c646d735356b32ec35f5f6ac65e770042cdbdb2)

Affected Resource(s)

  • aws_spot_instance_request

    Terraform Configuration Files

resource "aws_spot_instance_request" "cheap_worker" {
    ami = "ami-f568a095"
    spot_price = "0.001"
    instance_type = "m1.small"
    wait_for_fulfillment = true
    tags {
        Name = "CheapWorker"
    }
}

Expected Behavior

Either

* aws_spot_instance_request.cheap_worker: Error while waiting for spot request: "price-too-low": Your Spot request price of 0.001 is lower than the minimum required Spot request fulfillment price of 0.0082.

or (better) retry on such error code until timeout and then return the error ^.

Actual Behavior

* aws_spot_instance_request.cheap_worker: Error while waiting for spot request ({
  CreateTime: 2016-08-15 14:44:30 +0000 UTC,
  LaunchSpecification: {
    EbsOptimized: false,
    IamInstanceProfile: {
      Name: ""
    },
    ImageId: "ami-f568a095",
    InstanceType: "m1.small",
    Monitoring: {
      Enabled: false
    },
    Placement: {
      AvailabilityZone: "us-west-2c",
      GroupName: ""
    },
    SecurityGroups: [{
        GroupId: "sg-2ee3764a",
        GroupName: "default"
      }],
    SubnetId: "subnet-4b2afe23"
  },
  ProductDescription: "Linux/UNIX",
  SpotInstanceRequestId: "sir-04ckeqam",
  SpotPrice: "0.001000",
  State: "open",
  Status: {
    Code: "pending-evaluation",
    Message: "Your Spot request has been submitted for review, and is pending evaluation.",
    UpdateTime: 2016-08-15 14:44:30 +0000 UTC
  },
  Type: "persistent"
}) to resolve: unexpected state 'price-too-low', wanted target 'fulfilled'. last error: %!s(<nil>)

Steps to Reproduce

  1. terraform apply
bug provideaws

Most helpful comment

LOL. You mean that error wasn't user friendly?

Agreed we can do _way_, _way_ better. :)

All 2 comments

LOL. You mean that error wasn't user friendly?

Agreed we can do _way_, _way_ better. :)

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings