Skip to content

Commit

Permalink
Add new attribute to databricks_job resource (#1988)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexott committed Feb 8, 2023
1 parent a4b5d95 commit f4087ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clusters/clusters_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ type Cluster struct {
ClusterLogConf *StorageInfo `json:"cluster_log_conf,omitempty"`
DockerImage *DockerImage `json:"docker_image,omitempty"`

DataSecurityMode string `json:"data_security_mode,omitempty"`
DataSecurityMode string `json:"data_security_mode,omitempty" tf:"suppress_diff"`
SingleUserName string `json:"single_user_name,omitempty"`
IdempotencyToken string `json:"idempotency_token,omitempty" tf:"force_new"`
WorkloadType *WorkloadType `json:"workload_type,omitempty"`
Expand Down
7 changes: 7 additions & 0 deletions jobs/resource_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ type JobCluster struct {
NewCluster *clusters.Cluster `json:"new_cluster,omitempty" tf:"group:cluster_type"`
}

type ContinuousConf struct {
PauseStatus string `json:"pause_status,omitempty" tf:"computed"`
}

// JobSettings contains the information for configuring a job on databricks
type JobSettings struct {
Name string `json:"name,omitempty" tf:"default:Untitled"`
Expand Down Expand Up @@ -207,6 +211,7 @@ type JobSettings struct {
// END Jobs + Repo integration preview

Schedule *CronSchedule `json:"schedule,omitempty"`
Continuous *ContinuousConf `json:"continuous,omitempty"`
MaxConcurrentRuns int32 `json:"max_concurrent_runs,omitempty"`
EmailNotifications *EmailNotifications `json:"email_notifications,omitempty" tf:"suppress_diff"`
WebhookNotifications *WebhookNotifications `json:"webhook_notifications,omitempty" tf:"suppress_diff"`
Expand Down Expand Up @@ -567,6 +572,8 @@ var jobSchema = common.StructToSchema(JobSettings{},
Default: false,
Type: schema.TypeBool,
}
s["schedule"].ConflictsWith = []string{"continuous"}
s["continuous"].ConflictsWith = []string{"schedule"}
return s
})

Expand Down

0 comments on commit f4087ca

Please sign in to comment.