Reputation: 548
I have
"aws_spot_instance_request" "server" {}
which starts just fine"aws_ebs_volume" "spill" {}
. For EBS requires availability_zone, that I try to get from aws_spot_instance_request.server.availability_zone
, but in .tfstate the "availability_zone" of server is null. That leads to:Error: Reference to undeclared resource.
How can I get the availability_zone of spot instance?
Upvotes: 0
Views: 129
Reputation: 776
From the looks of it, the availability zone attribute isn't exported from aws_spot_instance_request
. You can see the list of available attributes here
I would perhaps look at using the aws_spot_fleet_request
resource with a target capacity of 1. This way you can achieve the same effect and use a launch configuration to specify the availability zone, and then reference it in the attributes (as shown here)
Upvotes: 1