Skip to content

feat: module and example to create compute policies#226

Open
steven-muschler wants to merge 7 commits intodatabricks:mainfrom
steven-muschler:main
Open

feat: module and example to create compute policies#226
steven-muschler wants to merge 7 commits intodatabricks:mainfrom
steven-muschler:main

Conversation

@steven-muschler
Copy link

Adding in TF module and example that demonstrates how to create compute policies using policy families and allow for team specific overrides

@steven-muschler steven-muschler requested review from a team as code owners February 3, 2026 01:34
Comment on lines 7 to 8
policy_key = "personal-vm"
policy_family_id = "personal-vm"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need both if they are the same?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexott let me put in a better example for this scenario. The reason these are separate because DLT/SDP does not have a policy family, but requires specific policy elements like cluster_type

Description for all variables
Remove alias as only one provider is used in this example
Show example of when policy_key and policy_family_id are different
@alexott alexott requested a review from Copilot February 4, 2026 14:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a Terraform module for creating Databricks cluster policies based on policy families, with support for environment-specific configurations and team-level customization. The implementation provides a reusable framework for managing compute policies across different teams and environments.

Changes:

  • Added a new Terraform module cluster-policy-from-policy-family that creates cluster policies with configurable overrides
  • Implemented JSON-based policy configurations for different environments (dev/prod), runtimes (standard/ML), and cluster types
  • Created an example configuration demonstrating multi-team policy deployment with team-specific overrides

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
modules/cluster-policy-from-policy-family/variables.tf Defines input variables for team, environment, policy version, and override configurations
modules/cluster-policy-from-policy-family/provider.tf Configures required Databricks provider
modules/cluster-policy-from-policy-family/outputs.tf Exposes the created policy ID
modules/cluster-policy-from-policy-family/cluster-policies.tf Main module logic that merges policy configurations and creates resources
modules/cluster-policy-from-policy-family/cluster_policy_json/*.json JSON configuration files for various policy components
modules/cluster-policy-from-policy-family/README.md Module documentation
modules/cluster-policy-from-policy-family/Makefile Build targets for documentation generation
examples/cluster-policies/*.tf Example implementation showing multi-team usage
examples/cluster-policies/example.tfvars Sample variable values for the example
examples/cluster-policies/README.md Example documentation
examples/cluster-policies/Makefile Build targets for example documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 13 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

steven-muschler and others added 3 commits February 10, 2026 08:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment on lines +15 to +17
group_assignments = list(string)
service_principal_assignments = list(string)
user_assignments = list(string)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make them optional with [] as default

policy_key = "sdp-cluster"
policy_family_id = "job-cluster"
group_assignments = ["groupA"]
service_principal_assignments = []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we would be able to remove these default values if we change the declaration of a variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants