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

Add web_app_routing_identity block to outputs #481

Merged
merged 2 commits into from
Nov 29, 2023
Merged

Add web_app_routing_identity block to outputs #481

merged 2 commits into from
Nov 29, 2023

Conversation

bonddim
Copy link
Contributor

@bonddim bonddim commented Nov 28, 2023

Describe your changes

This add web_app_routing_identity to outputs, which is needed for role assignments when DNS zone and AKS Cluster are in different resource groups.

Checklist before requesting a review

  • The pr title can be used to describe what this pr did in CHANGELOG.md file
  • I have executed pre-commit on my machine
  • I have passed pr-check on my machine

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 @bonddim for opening this pr! Almost LGTM but two review comments.

outputs.tf Outdated

output "web_app_routing_identity" {
description = "The `azurerm_kubernetes_cluster`'s `web_app_routing_identity` block."
value = try(azurerm_kubernetes_cluster.main.web_app_routing[0].web_app_routing_identity, null)
Copy link
Member

Choose a reason for hiding this comment

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

According to the schema, web_app_routing_identity is a list of object, so I would recommend [] as default value instead of null, so the consumer can use for expression to iterate it:

value       = try(azurerm_kubernetes_cluster.main.web_app_routing[0].web_app_routing_identity, [])

Otherwise, we'll receive an error when we're using for expression and this output is null:

Error: Iteration over null value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

outputs.tf Outdated
@@ -223,3 +223,8 @@ output "username" {
sensitive = true
value = azurerm_kubernetes_cluster.main.kube_config[0].username
}

output "web_app_routing_identity" {
description = "The `azurerm_kubernetes_cluster`'s `web_app_routing_identity` block."
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to address that this block is a list of object:

description = "The azurerm_kubernetes_cluster's web_app_routing_identity block, it's type is a list of object."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

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 @bonddim , LGTM! 🚀

@lonegunmanb lonegunmanb merged commit b809008 into Azure:main Nov 29, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants