Skip to content

Commit 1558b98

Browse files
authored
Merge pull request #3 from kumarvna/develop
updating examples
2 parents 607b30a + 18b6c20 commit 1558b98

File tree

5 files changed

+32
-26
lines changed

5 files changed

+32
-26
lines changed

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ module "key-vault" {
1212
version = "2.1.0"
1313
1414
# Resource Group and Key Vault pricing tier details
15-
resource_group_name = "rg-demo-project-shared-westeurope-001"
15+
resource_group_name = "rg-shared-westeurope-01"
1616
key_vault_name = "demo-project-shard"
1717
key_vault_sku_pricing_tier = "premium"
1818
1919
# Once `Purge Protection` has been Enabled it's not possible to Disable it
20-
# Deleting the Key Vault with `Purge Protection` enabled will schedule the Key Vault to be deleted (currently 90 days)
21-
# Once `Soft Delete` has been Enabled it's not possible to Disable it.
20+
# Deleting the Key Vault with `Purge Protection` enabled will schedule the Key Vault to be deleted
21+
# The default retention period is 90 days, possible values are from 7 to 90 days
22+
# use `soft_delete_retention_days` to set the retention period
2223
enable_purge_protection = false
23-
enable_soft_delete = false
2424
25-
# Adding Key valut logs to Azure monitoring and Log Analytics space
25+
# Adding Key vault logs to Azure monitoring and Log Analytics space
26+
# to enable key-vault logs, either one of log_analytics_workspace_id or storage_account_id required
2627
log_analytics_workspace_id = var.log_analytics_workspace_id
2728
storage_account_id = var.storage_account_id
2829
@@ -37,23 +38,24 @@ module "key-vault" {
3738
storage_permissions = ["backup", "get", "list", "recover"]
3839
},
3940
40-
# Access policies for AD Groups, enable this feature to provide list of Azure AD groups and set permissions.
41+
# Access policies for AD Groups, enable this feature to provide list of Azure AD groups and set permissions.
4142
{
4243
azure_ad_group_names = ["ADGroupName1", "ADGroupName2"]
4344
secret_permissions = ["get", "list", "set"]
4445
},
46+
4547
]
4648
4749
# Create a required Secrets as per your need.
48-
# When you Add `usernames` with empty password this module creates a strong random password
49-
# use .tfvars file to manage the secrets to avoid security violations.
50+
# When you Add `usernames` with empty password this module creates a strong random password
51+
# use .tfvars file to manage the secrets as variables to avoid security issues.
5052
secrets = {
5153
"message" = "Hello, world!"
5254
"vmpass" = ""
5355
}
5456
5557
# Adding TAG's to your Azure resources (Required)
56-
# ProjectName and Env are already declared above, to use them here or create a varible.
58+
# ProjectName and Env are already declared above, to use them here or create a varible.
5759
tags = {
5860
ProjectName = "demo-project"
5961
Env = "dev"
@@ -113,7 +115,7 @@ When you need to pass a secure value (like a password) as a parameter during dep
113115

114116
When soft-delete is enabled, resources marked as deleted resources are retained for a specified period (90 days by default). The service further provides a mechanism for recovering the deleted object, essentially undoing the deletion.
115117

116-
When creating a new key vault, soft-delete is enabled by default. __The ability to opt out of soft-delete will be deprecated by the end of the year 2020__, and soft-delete protection will automatically be turned on for all key vaults.
118+
When creating a new key vault, soft-delete is enabled by default. __As of 2020-12-15 Azure now requires that Soft Delete is enabled on Key Vaults and this can no longer be disabled__.
117119

118120
Purge protection is an optional Key Vault behavior and is not enabled by default. Purge protection can only be enabled once soft-delete is enabled. It can be turned on using this module by setting the argument `enable_purge_protection = true`.
119121

examples/complete/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ module "key-vault" {
1010
version = "2.1.0"
1111
1212
# Resource Group and Key Vault pricing tier details
13-
resource_group_name = "rg-demo-project-shared-westeurope-001"
13+
resource_group_name = "rg-shared-westeurope-01"
1414
key_vault_name = "demo-project-shard"
1515
key_vault_sku_pricing_tier = "premium"
1616
1717
# Once `Purge Protection` has been Enabled it's not possible to Disable it
18-
# Deleting the Key Vault with `Purge Protection` enabled will schedule the Key Vault to be deleted (currently 90 days)
19-
# Once `Soft Delete` has been Enabled it's not possible to Disable it.
18+
# Deleting the Key Vault with `Purge Protection` enabled will schedule the Key Vault to be deleted
19+
# The default retention period is 90 days, possible values are from 7 to 90 days
20+
# use `soft_delete_retention_days` to set the retention period
2021
enable_purge_protection = false
21-
enable_soft_delete = false
2222
23-
# Adding Key valut logs to Azure monitoring and Log Analytics space
23+
# Adding Key vault logs to Azure monitoring and Log Analytics space
24+
# to enable key-vault logs, either one of log_analytics_workspace_id or storage_account_id required
2425
log_analytics_workspace_id = var.log_analytics_workspace_id
2526
storage_account_id = var.storage_account_id
2627
@@ -35,23 +36,24 @@ module "key-vault" {
3536
storage_permissions = ["backup", "get", "list", "recover"]
3637
},
3738
38-
# Access policies for AD Groups, enable this feature to provide list of Azure AD groups and set permissions.
39+
# Access policies for AD Groups, enable this feature to provide list of Azure AD groups and set permissions.
3940
{
4041
azure_ad_group_names = ["ADGroupName1", "ADGroupName2"]
4142
secret_permissions = ["get", "list", "set"]
4243
},
44+
4345
]
4446
4547
# Create a required Secrets as per your need.
46-
# When you Add `usernames` with empty password this module creates a strong random password
47-
# use .tfvars file to manage the secrets to avoid security violations.
48+
# When you Add `usernames` with empty password this module creates a strong random password
49+
# use .tfvars file to manage the secrets as variables to avoid security issues.
4850
secrets = {
4951
"message" = "Hello, world!"
5052
"vmpass" = ""
5153
}
5254
5355
# Adding TAG's to your Azure resources (Required)
54-
# ProjectName and Env are already declared above, to use them here or create a varible.
56+
# ProjectName and Env are already declared above, to use them here or create a varible.
5557
tags = {
5658
ProjectName = "demo-project"
5759
Env = "dev"

examples/complete/main.tf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ module "key-vault" {
33
version = "2.1.0"
44

55
# Resource Group and Key Vault pricing tier details
6-
resource_group_name = "rg-sap-test-kumars" #"rg-shared-westeurope-01"
6+
resource_group_name = "rg-shared-westeurope-01"
77
key_vault_name = "demo-project-shard"
88
key_vault_sku_pricing_tier = "premium"
99

1010
# Once `Purge Protection` has been Enabled it's not possible to Disable it
11-
# Deleting the Key Vault with `Purge Protection` enabled will schedule the Key Vault to be deleted (currently 90 days)
12-
# Once `Soft Delete` has been Enabled it's not possible to Disable it.
11+
# Deleting the Key Vault with `Purge Protection` enabled will schedule the Key Vault to be deleted
12+
# The default retention period is 90 days, possible values are from 7 to 90 days
13+
# use `soft_delete_retention_days` to set the retention period
1314
enable_purge_protection = false
1415

15-
# Adding Key valut logs to Azure monitoring and Log Analytics space
16+
# Adding Key vault logs to Azure monitoring and Log Analytics space
17+
# to enable key-vault logs, either one of log_analytics_workspace_id or storage_account_id required
1618
log_analytics_workspace_id = var.log_analytics_workspace_id
1719
storage_account_id = var.storage_account_id
1820

@@ -27,7 +29,7 @@ module "key-vault" {
2729
storage_permissions = ["backup", "get", "list", "recover"]
2830
},
2931

30-
/* # Access policies for AD Groups, enable this feature to provide list of Azure AD groups and set permissions.
32+
/* # Access policies for AD Groups, enable this feature to provide list of Azure AD groups and set permissions.
3133
{
3234
azure_ad_group_names = ["ADGroupName1", "ADGroupName2"]
3335
secret_permissions = ["get", "list", "set"]

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ resource "azurerm_monitor_diagnostic_setting" "diag" {
168168
target_resource_id = azurerm_key_vault.main.id
169169
log_analytics_workspace_id = var.log_analytics_workspace_id
170170
log_analytics_destination_type = "Dedicated"
171-
storage_account_id = var.storage_account_id
171+
storage_account_id = var.storage_account_id != null ? var.storage_account_id : null
172172
log {
173173
category = "AuditEvent"
174174
enabled = true

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ variable "log_analytics_workspace_id" {
6767

6868
variable "azure_monitor_logs_retention_in_days" {
6969
description = "The Azure Monitoring data retention in days."
70-
default = 30
70+
default = 0
7171
}
7272

7373
variable "storage_account_id" {

0 commit comments

Comments
 (0)