Skip to content

Commit

Permalink
Fix connector_resource_id validation
Browse files Browse the repository at this point in the history
  • Loading branch information
stefannica committed Nov 20, 2024
1 parent 6122210 commit 3305602
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/provider/resource_stack_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ func resourceStackComponent() *schema.Resource {

CustomizeDiff: func(ctx context.Context, d *schema.ResourceDiff, m interface{}) error {
// Validate that if connector_resource_id is set, connector should also be set
connector, hasConnector := d.GetOk("connector")
connector, hasConnector := d.GetOk("connector_id")
connectorResourceID, hasConnectorResourceID := d.GetOk("connector_resource_id")

if hasConnectorResourceID && connectorResourceID.(string) != "" && (!hasConnector || connector.(string) == "") {
return fmt.Errorf("connector must be set when connector_resource_id is specified")
return fmt.Errorf("connector_id must be set when connector_resource_id is specified")
}

return nil
Expand Down

0 comments on commit 3305602

Please sign in to comment.