Vikkes
Vikkes

Reputation: 548

Cannot get availability_zone in spot instance by terraform state

I have

Error: Reference to undeclared resource.

How can I get the availability_zone of spot instance?

Upvotes: 0

Views: 129

Answers (1)

tedsmitt
tedsmitt

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

Related Questions