the terraform plan fails with the following output:
+ terraform plan -input=false ../spec-applied/
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
[...]
cloudfoundry_isolation_segment.internet_isolation_segment: Refreshing state... (ID: 1de9160c-c572-4eb2-b9f6-7e08d98a9564)
[...]
Error: Error refreshing state: 1 error(s) occurred:
* cloudfoundry_isolation_segment.internet_isolation_segment: 1 error(s) occurred:
* cloudfoundry_isolation_segment.internet_isolation_segment: cloudfoundry_isolation_segment.internet_isolation_segment: Isolation segment not found
When the tfstate and tf specs contain an isolation segment which is not present in the cloud,
the
terraform plan
fails with the following output:The attempt to refresh the tfstate also fails with the same message:
Workaround: manually remove the missing isolation-segment from the tfstate:
$ terraform state list | grep isolation | xargs -n 1 terraform state rm