{"record":{"id":"624bb9091ff7050d","repo":"hashicorp/terraform","slug":"cannot-confirm-apply-due-to-input-false-please-h","errorCode":null,"errorMessage":"Cannot confirm apply due to -input=false. Please handle run confirmation in the UI.","messagePattern":"Cannot confirm apply due to -input=false\\. Please handle run confirmation in the UI\\.","errorType":"exception","errorClass":"errApplyNeedsUIConfirmation","httpStatus":null,"severity":"error","filePath":"internal/cloud/errors.go","lineNumber":22,"sourceCode":"package cloud\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/hashicorp/terraform/internal/tfdiags\"\n\t\"github.com/zclconf/go-cty/cty\"\n)\n\n// String based errors\nvar (\n\terrApplyDiscarded                    = errors.New(\"Apply discarded.\")\n\terrDestroyDiscarded                  = errors.New(\"Destroy discarded.\")\n\terrRunApproved                       = errors.New(\"approved using the UI or API\")\n\terrRunDiscarded                      = errors.New(\"discarded using the UI or API\")\n\terrRunOverridden                     = errors.New(\"overridden using the UI or API\")\n\terrApplyNeedsUIConfirmation          = errors.New(\"Cannot confirm apply due to -input=false. Please handle run confirmation in the UI.\")\n\terrPolicyOverrideNeedsUIConfirmation = errors.New(\"Cannot override soft failed policy checks when -input=false. Please open the run in the UI to override.\")\n)\n\n// Diagnostic error messages\nvar (\n\tinvalidWorkspaceConfigMissingValues = tfdiags.AttributeValue(\n\t\ttfdiags.Error,\n\t\t\"Invalid workspaces configuration\",\n\t\tfmt.Sprintf(\"Missing workspace mapping strategy. Either workspace \\\"tags\\\" or \\\"name\\\" is required.\\n\\n%s\", workspaceConfigurationHelp),\n\t\tcty.Path{cty.GetAttrStep{Name: \"workspaces\"}},\n\t)\n\n\tinvalidWorkspaceConfigMisconfiguration = tfdiags.AttributeValue(\n\t\ttfdiags.Error,\n\t\t\"Invalid workspaces configuration\",\n\t\tfmt.Sprintf(\"Only one of workspace \\\"tags\\\" or \\\"name\\\" is allowed.\\n\\n%s\", workspaceConfigurationHelp),\n\t\tcty.Path{cty.GetAttrStep{Name: \"workspaces\"}},\n\t)","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/cloud/errors.go#L4-L40","documentation":"errApplyNeedsUIConfirmation is returned when a cloud run reaches the apply-confirmation step but the CLI cannot prompt the user because -input=false was set and -auto-approve was not. Defined in errors.go:22, returned at backend_apply.go:174 when mustConfirm && !b.input. Terraform refuses to silently apply; it directs the user to confirm in the HCP Terraform UI.","triggerScenarios":"backend_apply.go:154-174: mustConfirm is true (UIIn/UIOut present, not AutoApprove), b.input is false (-input=false). The run is created and planned but apply is not auto-triggered; the error is returned so the operator confirms in the UI.","commonSituations":"Running 'terraform apply -input=false' (common in restricted CI shells) against the cloud backend without -auto-approve; a wrapper script that disables prompts but expects manual UI confirmation.","solutions":["Add -auto-approve to the command so Terraform confirms the apply programmatically: 'terraform apply -auto-approve'.","Or open the run URL printed by Terraform and click Confirm in the HCP Terraform UI.","Remove -input=false if an interactive prompt is acceptable in your shell."],"exampleFix":"# before\n$ terraform apply -input=false\n# after\n$ terraform apply -auto-approve","handlingStrategy":"validation","validationCode":"// Before running apply against the cloud backend, resolve the input/approval combo.\nfunc applyArgs(inputEnabled, autoApprove bool) []string {\n    args := []string{\"apply\"}\n    if !inputEnabled {\n        // -input=false requires -auto-approve or the run must be confirmed in the UI\n        if !autoApprove {\n            log.Println(\"WARNING: apply -input=false without -auto-approve forces UI confirmation\")\n        }\n        args = append(args, \"-input=false\")\n    }\n    if autoApprove {\n        args = append(args, \"-auto-approve\")\n    }\n    return args\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pair -input=false with -auto-approve in CI to avoid forced UI confirmation.","If you want manual control, omit -input=false and keep the prompt.","Document the run URL pattern so operators know where to confirm in the UI."],"tags":["cloud-backend","apply","input-disabled","auto-approve","ui-confirmation"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}