diff --git a/CHANGELOG.md b/CHANGELOG.md index a9b3f2d72..de8084a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ BUG FIXES: * Fixed default provider organization usage for `r/tfe_admin_organization_settings`, by @brandonc [1183](https://github.com/hashicorp/terraform-provider-tfe/pull/1183) +* `/r/tfe_workspace_settings`: Fix compatibility with older versions of Terraform Enterprise when using agent execution by @brandonc [1193](https://github.com/hashicorp/terraform-provider-tfe/pull/1193) # v0.51.0 diff --git a/internal/provider/resource_tfe_workspace_settings.go b/internal/provider/resource_tfe_workspace_settings.go index f8ab6653b..f6fabaff6 100644 --- a/internal/provider/resource_tfe_workspace_settings.go +++ b/internal/provider/resource_tfe_workspace_settings.go @@ -166,9 +166,11 @@ func (m unknownIfExecutionModeUnset) PlanModifyString(ctx context.Context, req p if configured.ExecutionMode.IsNull() && overwritesState[0].ExecutionMode.ValueBool() { resp.PlanValue = types.StringUnknown() } - } else if req.Path.Equal(path.Root("execution_mode")) { + } else if configured.ExecutionMode.IsNull() && req.Path.Equal(path.Root("execution_mode")) { // TFE does not support overwrites so default the execution mode to "remote" resp.PlanValue = types.StringValue("remote") + } else if configured.AgentPoolID.IsNull() && req.Path.Equal(path.Root("agent_pool_id")) { + resp.PlanValue = types.StringNull() } }