{"record":{"id":"2c9fcf4f37495d95","repo":"hashicorp/terraform","slug":"connection-type-s-not-supported","errorCode":null,"errorMessage":"connection type '%s' not supported","messagePattern":"connection type '(.+?)' not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/communicator/communicator.go","lineNumber":70,"sourceCode":"func New(v cty.Value) (Communicator, error) {\n\tv, err := shared.ConnectionBlockSupersetSchema.CoerceValue(v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttypeVal := v.GetAttr(\"type\")\n\tconnType := \"\"\n\tif !typeVal.IsNull() {\n\t\tconnType = typeVal.AsString()\n\t}\n\n\tswitch connType {\n\tcase \"ssh\", \"\": // The default connection type is ssh, so if connType is empty use ssh\n\t\treturn ssh.New(v)\n\tcase \"winrm\":\n\t\treturn winrm.New(v)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"connection type '%s' not supported\", connType)\n\t}\n}\n\n// maxBackoffDelay is the maximum delay between retry attempts\nvar maxBackoffDelay = 20 * time.Second\nvar initialBackoffDelay = time.Second\n\n// in practice we want to abort the retry asap, but for tests we need to\n// synchronize the return.\nvar retryTestWg *sync.WaitGroup\n\n// Fatal is an interface that error values can return to halt Retry\ntype Fatal interface {\n\tFatalError() error\n}\n\n// Retry retries the function f until it returns a nil error, a Fatal error, or\n// the context expires.","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/communicator/communicator.go#L52-L88","documentation":"communicator.New at communicator.go:52 dispatches on the connection block's 'type' attribute. Only 'ssh' (also the default when type is empty, per line 65) and 'winrm' are implemented. Any other value falls through to the default case at communicator.go:70.","triggerScenarios":"A provisioner connection block specifies type = \"telnet\" (or any value other than ssh/winrm/empty).","commonSituations":"Typo in the connection type; assuming a connector (e.g. 'docker', 'local') exists when it doesn't; copy-pasting a connection block from an unsupported example.","solutions":["Use 'ssh' for Linux/Unix targets or 'winrm' for Windows targets.","Omit 'type' entirely to get the default (ssh).","Re-check the connection block inside your provisioner/resource for the typo."],"exampleFix":"// before\nconnection {\n  type     = \"shh\"   // typo\n  user     = \"ubuntu\"\n  host     = aws_instance.web.public_ip\n}\nError: connection type 'shh' not supported\n\n// after\nconnection {\n  type     = \"ssh\"\n  user     = \"ubuntu\"\n  host     = aws_instance.web.public_ip\n}","handlingStrategy":"validation","validationCode":"// Validate the connection type before constructing the communicator.\nfunc isValidConnType(t string) bool {\n    switch t {\n    case \"\", \"ssh\", \"winrm\":\n        return true\n    }\n    return false\n}\nif !isValidConnType(connType) {\n    return fmt.Errorf(\"unsupported connection type %q (use ssh or winrm)\", connType)\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Document and lint connection block types to ssh/winrm only.","Omit 'type' to default to ssh and avoid typos.","Add a config validator for provisioner connection blocks."],"tags":["terraform","provisioner","connection","ssh","winrm"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}