Other: Terraform Deleted Connector Detection & Improvement
Summary
When a Fivetran connector managed by Terraform is deleted outside of Terraform (via the UI or API), the provider errors out on the next plan or apply instead of detecting the drift and planning a re-create. This breaks the standard Terraform provider contract and requires manual state surgery to recover.
Current Behavior
When terraform plan runs and the provider's Read call receives a 404 NotFound_Connector, it returns a hard error and halts execution:
status code: 404; expected: 200; code: NotFound_Connector;
message: Cannot find entity 'Connector' with id '...'.
The user must manually run terraform state rm <resource> before Terraform can recover.
Expected Behavior
When the provider receives a 404 on Read, it should signal to Terraform that the resource no longer exists. Terraform will then plan a re-create on the next apply. This is the standard practice across all major providers (AWS, GCP, Azure).
Business Impact
-
Operational issues: Any out-of-band deletion — accidental or intentional — immediately breaks all downstream
terraform planruns until an engineer manually repairs state, requiring Terraform knowledge and direct state access. - Pipeline problems: In environments where connectors are managed across many teams, a single UI deletion can block automated Terraform workflows (CI/CD pipelines) until manually resolved.
Proposed Fix
In the Read function for fivetran_connector (and any dependent resources), handle 404 responses and return without error, allowing Terraform to treat the resource as deleted and plan accordingly.
-
Official comment
Hi Jered,
This is Ryan, the PM for our Terraform Provider. We understand this is a problem and have added the fix to our roadmap. We will update this ticket when we have more information to share.
Best,
Ryan
Please sign in to leave a comment.
Comments
1 comment