databricks_credential

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DatabricksResourceSchema = resource_schema.Schema{
	Description: "Databricks credential resource",
	Attributes: map[string]resource_schema.Attribute{
		"id": resource_schema.StringAttribute{
			Description: "The ID of this resource. Contains the project ID and the credential ID.",
			Computed:    true,
			PlanModifiers: []planmodifier.String{
				stringplanmodifier.UseStateForUnknown(),
			},
		},
		"project_id": resource_schema.Int64Attribute{
			Description: "Project ID to create the Databricks credential in",
			Required:    true,
			PlanModifiers: []planmodifier.Int64{
				int64planmodifier.RequiresReplace(),
			},
		},
		"credential_id": resource_schema.Int64Attribute{
			Description: "The system Databricks credential ID",
			Computed:    true,
			PlanModifiers: []planmodifier.Int64{
				int64planmodifier.UseStateForUnknown(),
			},
		},
		"target_name": resource_schema.StringAttribute{
			Description:        "Target name",
			Optional:           true,
			Computed:           true,
			Default:            stringdefault.StaticString("default"),
			DeprecationMessage: "This field is deprecated at the environment level (it was never possible to set it in the UI) and will be removed in a future release. Please remove it and set the target name at the job level or leverage environment variables.",
		},
		"token": resource_schema.StringAttribute{
			Description: "Token for Databricks user",
			Required:    true,
			Sensitive:   true,
		},
		"catalog": resource_schema.StringAttribute{
			Description: "The catalog where to create models (only for the databricks adapter)",
			Optional:    true,
			Computed:    true,
			Default:     stringdefault.StaticString(""),
		},
		"schema": resource_schema.StringAttribute{
			Description: "The schema where to create models. Optional only when semantic_layer_credential is set to true; otherwise, this field is required.",
			Optional:    true,
			Computed:    true,
			Default:     stringdefault.StaticString("default_schema"),
			Validators: []validator.String{
				sl_cred_validator.SemanticLayerCredentialValidator{FieldName: "schema"},
			},
		},
		"adapter_type": resource_schema.StringAttribute{
			Description: "The type of the adapter (databricks or spark). Optional only when semantic_layer_credential is set to true; otherwise, this field is required.",
			Optional:    true,
			Computed:    true,
			Default:     stringdefault.StaticString("databricks"),
			PlanModifiers: []planmodifier.String{
				stringplanmodifier.RequiresReplace(),
			},
			Validators: []validator.String{
				stringvalidator.OneOf("databricks", "spark"),
				sl_cred_validator.SemanticLayerCredentialValidator{FieldName: "adapter_type"},
			},
		},
		"semantic_layer_credential": resource_schema.BoolAttribute{
			Optional:    true,
			Description: "This field indicates that the credential is used as part of the Semantic Layer configuration. It is used to create a Databricks credential for the Semantic Layer.",
			Computed:    true,
			Default:     booldefault.StaticBool(false),
		},
	},
}

Functions

func DatabricksCredentialDataSource

func DatabricksCredentialDataSource() datasource.DataSource

func DatabricksCredentialResource

func DatabricksCredentialResource() resource.Resource

Types

type DatabricksCredentialDataSourceModel

type DatabricksCredentialDataSourceModel struct {
	ID           types.String `tfsdk:"id"`
	CredentialID types.Int64  `tfsdk:"credential_id"`
	ProjectID    types.Int64  `tfsdk:"project_id"`
	AdapterType  types.String `tfsdk:"adapter_type"`
	TargetName   types.String `tfsdk:"target_name"`
	NumThreads   types.Int64  `tfsdk:"num_threads"`
	Catalog      types.String `tfsdk:"catalog"`
	Schema       types.String `tfsdk:"schema"`
}

type DatabricksCredentialResourceModel

type DatabricksCredentialResourceModel struct {
	ID                      types.String `tfsdk:"id"`
	CredentialID            types.Int64  `tfsdk:"credential_id"`
	ProjectID               types.Int64  `tfsdk:"project_id"`
	TargetName              types.String `tfsdk:"target_name"`
	Token                   types.String `tfsdk:"token"`
	Catalog                 types.String `tfsdk:"catalog"`
	Schema                  types.String `tfsdk:"schema"`
	AdapterType             types.String `tfsdk:"adapter_type"`
	SemanticLayerCredential types.Bool   `tfsdk:"semantic_layer_credential"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL