Skip to content

Commit

Permalink
Adding workspace deployment name variable
Browse files Browse the repository at this point in the history
Changes:
- Added `deployment_name` in our template
  • Loading branch information
flaviomalavazi committed May 14, 2024
1 parent 6523d99 commit 63a7713
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions aws/tf/modules/sra/databricks_account.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module "databricks_mws_workspace" {

databricks_account_id = var.databricks_account_id
resource_prefix = var.resource_prefix
deployment_name = var.deployment_name
security_group_ids = var.custom_sg_id != null ? [var.custom_sg_id] : [aws_security_group.sg[0].id]
subnet_ids = var.custom_private_subnet_ids != null ? var.custom_private_subnet_ids : module.vpc[0].private_subnets
vpc_id = var.custom_vpc_id != null ? var.custom_vpc_id : module.vpc[0].vpc_id
Expand Down
6 changes: 5 additions & 1 deletion aws/tf/modules/sra/databricks_account/workspace/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,8 @@ variable "managed_storage_key_alias" {

variable "workspace_storage_key_alias" {
type = string
}
}

variable "deployment_name" {
type = string
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ resource "databricks_mws_workspaces" "this" {
account_id = var.databricks_account_id
aws_region = var.region
workspace_name = var.resource_prefix
deployment_name = var.deployment_name
credentials_id = databricks_mws_credentials.this.credentials_id
storage_configuration_id = databricks_mws_storage_configurations.this.storage_configuration_id
network_id = databricks_mws_networks.this.network_id
Expand Down
5 changes: 5 additions & 0 deletions aws/tf/modules/sra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ variable "resource_prefix" {
type = string
}

variable "deployment_name" {
description = "Suffix for workspace names."
type = string
}

variable "sg_egress_ports" {
description = "List of egress ports for security groups."
type = list(string)
Expand Down
1 change: 1 addition & 0 deletions aws/tf/sra.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module "SRA" {
enable_cluster_boolean = false // WARNING: Clusters will spin-up Databricks clusters and AWS EC2 instances
enable_admin_configs = false // WARNING: The workspace_conf resource is evolving API that may change from provider to provider. Please review the in-resource documentation (admin_configuration.tf) before enabling.
workspace_service_principal_name = "sra-example-sp"
deployment_name = var.deployment_name

// Workspace - networking variables (optional if using custom operation mode):
vpc_cidr_range = "10.0.0.0/18"
Expand Down
3 changes: 2 additions & 1 deletion aws/tf/template.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ client_secret = ""
databricks_account_id = ""
region = ""
resource_owner = ""
resource_prefix = ""
resource_prefix = ""
deployment_name = ""
5 changes: 5 additions & 0 deletions aws/tf/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ variable "resource_prefix" {
type = string
}

variable "deployment_name" {
description = "Suffix for workspace names."
type = string
}

data "aws_availability_zones" "available" {
state = "available"
}
Expand Down

0 comments on commit 63a7713

Please sign in to comment.