{"record":{"id":"a78770f1e55761c5","repo":"kubernetes/kops","slug":"direct-configuration-not-supported-with-cloudprovi","errorCode":null,"errorMessage":"direct configuration not supported with CloudProvider:%q","messagePattern":"direct configuration not supported with CloudProvider:%q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/apply_cluster.go","lineNumber":769,"sourceCode":"\t\t\ttarget = gce.NewGCEAPITarget(cloud.(gce.GCECloud))\n\t\tcase kops.CloudProviderAWS:\n\t\t\ttarget = awsup.NewAWSAPITarget(cloud.(awsup.AWSCloud))\n\t\tcase kops.CloudProviderDO:\n\t\t\ttarget = do.NewDOAPITarget(cloud.(do.DOCloud))\n\t\tcase kops.CloudProviderHetzner:\n\t\t\ttarget = hetzner.NewHetznerAPITarget(cloud.(hetzner.HetznerCloud))\n\t\tcase kops.CloudProviderOpenstack:\n\t\t\ttarget = openstack.NewOpenstackAPITarget(cloud.(openstack.OpenstackCloud))\n\t\tcase kops.CloudProviderAzure:\n\t\t\ttarget = azure.NewAzureAPITarget(cloud.(azure.AzureCloud))\n\t\tcase kops.CloudProviderScaleway:\n\t\t\ttarget = scaleway.NewScwAPITarget(cloud.(scaleway.ScwCloud))\n\t\tcase kops.CloudProviderLinode:\n\t\t\ttarget = linode.NewAPITarget(cloud.(linode.LinodeCloud))\n\t\tcase kops.CloudProviderMetal:\n\t\t\ttarget = metal.NewAPITarget(cloud.(*metal.Cloud), nil)\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"direct configuration not supported with CloudProvider:%q\", cluster.GetCloudProvider())\n\t\t}\n\n\tcase TargetTerraform:\n\t\toutDir := c.OutDir\n\t\ttf := terraform.NewTerraformTarget(cloud, project, outDir, cluster.Spec.Target)\n\n\t\t// Register an azurerm provider alias for state storage blobs.\n\t\t// If the storage account is in a different subscription, pass subscription_id.\n\t\tif azureSpec := cluster.Spec.CloudProvider.Azure; azureSpec != nil {\n\t\t\targs := map[string]string{}\n\t\t\tif azureSpec.StorageAccountID != \"\" {\n\t\t\t\tstorageAccountID, err := arm.ParseResourceID(azureSpec.StorageAccountID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"parsing StorageAccountID: %w\", err)\n\t\t\t\t}\n\t\t\t\tif storageAccountID.SubscriptionID != azureSpec.SubscriptionID {\n\t\t\t\t\targs[\"subscription_id\"] = storageAccountID.SubscriptionID\n\t\t\t\t}","sourceCodeStart":751,"sourceCodeEnd":787,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/apply_cluster.go#L751-L787","documentation":"When c.Target is TargetDirect (applying changes directly to a cloud API), Run selects the concrete APITarget via a switch over CloudProvider; a provider without a direct-apply target implementation hits default and returns 'direct configuration not supported'. Direct apply exists for known providers only — some providers only support terraform output.","triggerScenarios":"Running `kops update cluster` without --target=terraform (i.e. direct apply) on a provider whose case is absent from the TargetDirect switch in apply_cluster.go.","commonSituations":"Using a newly added/alpha provider (or fork provider) that only supports generating terraform, assuming direct apply works; running `kops apply` style flows against unsupported clouds.","solutions":["Use terraform output instead: `kops update cluster --target=terraform` and apply the generated tf files","Use a provider that supports direct apply (aws, gce, etc.) for direct configuration","If implementing a provider, add a NewAPITarget case to the TargetDirect switch"],"exampleFix":"// before\nkops update cluster --name x  # direct apply\n// after\nkops update cluster --name x --target=terraform\ncd out/terraform && terraform plan","handlingStrategy":"validation","validationCode":"[ \"$CLOUD\" = aws ] || [ \"$CLOUD\" = gce ] || echo \"direct apply may be unsupported for $CLOUD; use --target=terraform\"","typeGuard":null,"tryCatchPattern":"if err := updateCluster(); err != nil { if strings.Contains(err.Error(), \"direct configuration not supported\") { return fmt.Errorf(\"use --target=terraform for this provider: %w\", err) } return err }","preventionTips":["For alpha/new providers, default to --target=terraform workflows","Check provider docs for direct-apply support before omitting --target","Script applies per provider with the supported target mode"],"tags":["target","terraform","cloudprovider","unsupported"],"backgroundTag":"unsupported-target-for-provider","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}