Skip to content

Commit ac1ca69

Browse files
author
Szymon Rozek
committed
push data for key vault secret
1 parent 2259f37 commit ac1ca69

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

data/key_vault_secret/main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
data "azurerm_key_vault" "key_vault" {
2+
name = var.key_vault_name
3+
resource_group_name = var.resource_group_name
4+
}
5+
6+
data "azurerm_key_vault_secret" "key_vault_secret" {
7+
name = var.secret_name
8+
key_vault_id = data.azurerm_key_vault.key_vault.id
9+
}

data/key_vault_secret/outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
output "secret_value" {
2+
value = data.azurerm_key_vault_secret.key_vault_secret.value
3+
sensitive = true
4+
}

data/key_vault_secret/variables.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
variable "key_vault_name" {
2+
description = "The name of the Key Vault."
3+
type = string
4+
}
5+
6+
variable "resource_group_name" {
7+
description = "The name of the resource group containing the Key Vault."
8+
type = string
9+
}
10+
11+
variable "secret_name" {
12+
description = "The name of the secret to retrieve."
13+
type = string
14+
}

0 commit comments

Comments
 (0)