-
Notifications
You must be signed in to change notification settings - Fork 807
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
User Story 60501: 101-databricks-cmk-dbfs #219
User Story 60501: 101-databricks-cmk-dbfs #219
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Looking great!
Few comments, suggestions and questions.
#please-hold-off I'm still making changes. Please don't review yet. |
@grayzu @lonegunmanb I made all the edits and tested the changes. Please review. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job @TomArcherMsft, only one tiny suggestion
Thanks @lonegunmanb. I made the edit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @TomArcherMsft , a few comments
} | ||
|
||
resource "random_pet" "azurerm_key_vault_key_name" { | ||
count = var.key_name == null ? 1 : 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In line 72:
resource "azurerm_key_vault_key" "key" {
name = coalesce(var.key_name, random_pet.azurerm_key_vault_key_name[0].id)
So when var.key_name
equals to empty string(""
) it would lead to random_pet.azurerm_key_vault_key_name[0]
, but random_pet.azurerm_key_vault_key_name
would be created only when var.key_name
is null
.
We can use the following toggle expression:
count = var.key_name == null || var.key_name == "" ? 1 : 0
@stemaMSFT @lonegunmanb I made the requested changes. Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apology for the confusion @TomArcherMsft, I didn't make my suggestion clear, would you please adjust your code? Thanks!
@lonegunmanb Thanks for the clarification! I made the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @TomArcherMsft thanks for the update, we still got one issue here.
resource "azurerm_key_vault_key" "key" {
name = coalesce(var.key_name, random_pet.azurerm_key_vault_key_name[0].id)
coalesce
takes any number of arguments and returns the first one that isn't null or an empty string.
So if var.key_name
is set to ""
, coalesce
would return random_pet.azurerm_key_vault_key_name[0].id
. But random_pet.azurerm_key_vault_key_name
's declaration is:
resource "random_pet" "azurerm_key_vault_key_name" {
count = var.key_name == null ? 1 : 0
var.key_name = ""
would lead to 0
, that would cause an error. So we should change it to:
resource "random_pet" "azurerm_key_vault_key_name" {
count = var.key_name == null || var.key_name == "" ? 1 : 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
variable "msi_id" { | ||
type = string | ||
description = "The Managed Service Identity ID. If this value isn't null (the default), the Azure Key Vault Object ID will be set to this value." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would the following description be better?:
description = "The Managed Service Identity ID, set this value if you're running this example by using Managed Identity as authentication method."
No description provided.