Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt user if Terraform utilised for deploying infrastructure #1004

Merged
merged 4 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/databricks/labs/ucx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class WorkspaceConfig: # pylint: disable=too-many-instance-attributes
policy_id: str | None = None
num_days_submit_runs_history: int = 30

# Flag to see if terraform has been used for deploying certain entities
is_terraform_used: bool = False

def replace_inventory_variable(self, text: str) -> str:
return text.replace("$inventory", f"hive_metastore.{self.inventory_database}")

Expand Down
4 changes: 4 additions & 0 deletions src/databricks/labs/ucx/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ def warehouse_type(_):
instance_profile, spark_conf_dict = self._get_ext_hms_conf_from_policy(cluster_policy)

policy_id = self._create_cluster_policy(inventory_database, spark_conf_dict, instance_profile)

# Check if terraform is being used
is_terraform_used = self._prompts.confirm("Do you use Terraform to deploy your infrastructure?")
config = WorkspaceConfig(
inventory_database=inventory_database,
workspace_group_regex=configure_groups.workspace_group_regex,
Expand All @@ -258,6 +261,7 @@ def warehouse_type(_):
instance_profile=instance_profile,
spark_conf=spark_conf_dict,
policy_id=policy_id,
is_terraform_used=is_terraform_used,
)
self._installation.save(config)
ws_file_url = self._installation.workspace_link(config.__file__)
Expand Down
Loading