Skip to content

Instantly share code, notes, and snippets.

@abhiyerra
Created September 26, 2016 20:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhiyerra/aae17b550c92bf4bcbd7b90529ccbd8a to your computer and use it in GitHub Desktop.
Save abhiyerra/aae17b550c92bf4bcbd7b90529ccbd8a to your computer and use it in GitHub Desktop.
parkingspot-terraform-spot-fleet
resource "aws_spot_fleet_request" "cheap_compute" {
iam_fleet_role = "arn:aws:iam::12345678:role/spot-fleet"
spot_price = "0.03"
allocation_strategy = "diversified"
target_capacity = 6
valid_until = "2019-11-04T20:44:20Z"
launch_specification {
instance_type = "m4.10xlarge"
ami = "ami-1234"
spot_price = "2.793"
}
launch_specification {
instance_type = "m4.4xlarge"
ami = "ami-5678"
key_name = "my-key"
spot_price = "1.117"
availability_zone = "us-west-1a"
subnet_id = "subnet-1234"
weighted_capacity = 35
root_block_device {
volume_size = "300"
volume_type = "gp2"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment