Skip to content
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

Merged

Conversation

TomArcherMsft
Copy link
Collaborator

No description provided.

Copy link
Contributor

@grayzu grayzu left a 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.

quickstart/101-databricks-cmk-dbfs/main.tf Show resolved Hide resolved
quickstart/101-databricks-cmk-dbfs/main.tf Outdated Show resolved Hide resolved
quickstart/101-databricks-cmk-dbfs/main.tf Outdated Show resolved Hide resolved
quickstart/101-databricks-cmk-dbfs/main.tf Show resolved Hide resolved
quickstart/101-databricks-cmk-dbfs/main.tf Show resolved Hide resolved
quickstart/101-databricks-cmk-dbfs/main.tf Outdated Show resolved Hide resolved
@TomArcherMsft
Copy link
Collaborator Author

#please-hold-off I'm still making changes. Please don't review yet.

@TomArcherMsft
Copy link
Collaborator Author

@grayzu @lonegunmanb I made all the edits and tested the changes. Please review. Thanks!

Copy link
Member

@lonegunmanb lonegunmanb left a 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

quickstart/101-databricks-cmk-dbfs/main.tf Outdated Show resolved Hide resolved
@TomArcherMsft
Copy link
Collaborator Author

Good job @TomArcherMsft, only one tiny suggestion

Thanks @lonegunmanb. I made the edit.

Copy link
Contributor

@grayzu grayzu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@lonegunmanb lonegunmanb left a 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

quickstart/101-databricks-cmk-dbfs/main.tf Outdated Show resolved Hide resolved
quickstart/101-databricks-cmk-dbfs/main.tf Show resolved Hide resolved
quickstart/101-databricks-cmk-dbfs/main.tf Outdated Show resolved Hide resolved
quickstart/101-databricks-cmk-dbfs/main.tf Outdated Show resolved Hide resolved
}

resource "random_pet" "azurerm_key_vault_key_name" {
count = var.key_name == null ? 1 : 0
Copy link
Member

@lonegunmanb lonegunmanb May 16, 2023

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

@TomArcherMsft
Copy link
Collaborator Author

@stemaMSFT @lonegunmanb I made the requested changes. Please review.

Copy link
Member

@lonegunmanb lonegunmanb left a 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!

quickstart/101-databricks-cmk-dbfs/main.tf Outdated Show resolved Hide resolved
quickstart/101-databricks-cmk-dbfs/main.tf Outdated Show resolved Hide resolved
@TomArcherMsft
Copy link
Collaborator Author

@lonegunmanb Thanks for the clarification! I made the changes.

Copy link
Member

@lonegunmanb lonegunmanb left a 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

@TomArcherMsft TomArcherMsft temporarily deployed to acctests May 27, 2023 02:24 — with GitHub Actions Inactive
Copy link
Member

@lonegunmanb lonegunmanb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @TomArcherMsft, almost LGTM but only one description question.


The e2e test passed.


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."
Copy link
Member

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."

@TomArcherMsft TomArcherMsft temporarily deployed to acctests May 31, 2023 01:24 — with GitHub Actions Inactive
@lonegunmanb lonegunmanb merged commit 195aebd into Azure:master May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants