Skip to content

Commit

Permalink
Add new variables 'tenant_id' (#27)
Browse files Browse the repository at this point in the history
* add new variables 'tenant_id'

* update

---------

Co-authored-by: Hangyu Xu <[email protected]>
  • Loading branch information
xhy8759 and Hangyu Xu authored Oct 16, 2024
1 parent 7d94d6b commit 20aa22b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,14 @@ Type: `string`

Default: `"255.255.255.0"`

### <a name="input_tenant_id"></a> [tenant\_id](#input\_tenant\_id)

Description: (Optional) Value of the tenant id

Type: `string`

Default: `""`

### <a name="input_traffic_type"></a> [traffic\_type](#input\_traffic\_type)

Description: Traffic type of intent.
Expand Down
6 changes: 4 additions & 2 deletions keyvault.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
data "azurerm_client_config" "current" {}
data "azurerm_client_config" "current" {
count = var.tenant_id == "" ? 1 : 0
}

resource "azurerm_key_vault" "deployment_keyvault" {
count = var.create_key_vault ? 1 : 0
Expand All @@ -7,7 +9,7 @@ resource "azurerm_key_vault" "deployment_keyvault" {
name = var.random_suffix ? "${var.keyvault_name}-${random_integer.random_suffix.result}" : var.keyvault_name
resource_group_name = local.resource_group_name
sku_name = "standard"
tenant_id = data.azurerm_client_config.current.tenant_id
tenant_id = var.tenant_id == "" ? data.azurerm_client_config.current[0].tenant_id : var.tenant_id
enable_rbac_authorization = true
enabled_for_deployment = true
enabled_for_disk_encryption = true
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,12 @@ variable "subnet_mask" {
description = "The subnet mask for the network."
}

variable "tenant_id" {
type = string
default = ""
description = "(Optional) Value of the tenant id"
}

variable "traffic_type" {
type = list(string)
default = [
Expand Down

0 comments on commit 20aa22b

Please sign in to comment.