ikask
ikask

Reputation: 318

Terraform version 0.9.6 support spot fleet tags

Using Terraform 0.9.6 I get this error when I try to create spot fleet using the code below, but when I use v0.11.7, it works. Terraform doc is here. My question is how can I determine if this is due to lack of v0.9.6 features or if I'm using the syntax incorrectly. How can I find this out?

I need to make the sport fleet resource tags work with v0.9.6.

Error:

* aws_spot_fleet_request.cheap_compute: launch_specification.0: invalid or unknown key: tags

Code:

# Request a Spot fleet
resource "aws_spot_fleet_request" "cheap_compute" {
  iam_fleet_role      = "arn:aws:iam::xxxxxxxxxxxxx:role/aws-service-role/spotfleet.amazonaws.com/AWSServiceRoleForEC2SpotFleet"
  spot_price          = "0.03"
  allocation_strategy = "diversified"
  target_capacity     = 2
  valid_until         = "2018-07-21T20:44:20Z"

  launch_specification {
    instance_type     = "t2.micro"
    ami               = "ami-1853ac65"
    spot_price        = "0.777"
    availability_zone = "us-east-1a"
    key_name        = "${var.key_name}"

    tags {
      Name = "spot-fleet-example"}
  } 
} 

Upvotes: 0

Views: 122

Answers (1)

Brandon Miller
Brandon Miller

Reputation: 5065

Support for tags in aws_spot_fleet_request was added in the terraform-provider-aws in 1.2.0. This was almost 5 months after the release of Terraform 0.9.6. At that time of 0.9.6 providers were shipped with Terraform. They later moved to shipping independently as part of 0.10.0 a few months later. You'll need a newer version to get tag support.

Upvotes: 1

Related Questions