Home / Companies / Speakeasy / Blog / Post Details
Content Deep Dive

Automatic polling support for Terraform providers

Blog post from Speakeasy

Post Details
Company
Date Published
Author
Brian Flad
Word Count
1,100
Language
English
Hacker News Points
-
Summary

Terraform providers generated with Speakeasy now include automatic polling support for API operations that perform background processing, eliminating the need for manual waiter logic when resources need time to reach a desired state. This feature addresses the common pattern of long-running requests in infrastructure APIs, where operations such as creating database instances or spinning up compute resources are performed asynchronously. The polling support utilizes the x-speakeasy-polling OpenAPI extension, which defines success and failure criteria, as well as timing configurations, for these operations, allowing Terraform resources to automatically handle state transitions during the resource lifecycle, including create, update, delete, and read/refresh phases. This integration simplifies Terraform provider development by removing the need for custom polling logic, ensuring consistent behavior across resources, and providing robust error handling and a seamless user experience.