Say we have an instance which has been built with a
After downloading the JSON state file from S3 (assuming you’re hosting it remotely) then you can look in the state file for this resource using:
terraform show ~/Downloads/terraform-state-file.json | less
Assuming it’s called
my-instance you can search for it and you’ll find:
So, let’s say you want to taint this resource. Let’s try
show initially on it as it’s non-destructive so:
tf state show aws_instance.my-instance.0
But this gives:
Error filtering state: Error parsing address ‘aws_instance.my-instance.0’: Unexpected value for InstanceType field: “0”
Please ensure that all your addresses are formatted properly.
my-instancedoes not work.
You need to specify the instance using: