Skip to content

Add web_app_routing_identity block to outputs#481

Merged
lonegunmanb merged 2 commits intoAzure:mainfrom
Laki-Power:main
Nov 29, 2023
Merged

Add web_app_routing_identity block to outputs#481
lonegunmanb merged 2 commits intoAzure:mainfrom
Laki-Power:main

Conversation

@bonddim
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread 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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread outputs.tf Outdated
}

output "web_app_routing_identity" {
description = "The `azurerm_kubernetes_cluster`'s `web_app_routing_identity` block."
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
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