-
Notifications
You must be signed in to change notification settings - Fork 34
Conversation
outputs.tf
Outdated
|
||
output "principal_id" { | ||
description = "The Principal ID associated with this Managed Service Identity." | ||
value = azurerm_cognitive_account.this.identity[0].principal_id |
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.
@lonegunmanb Question: is it correct to create an output for each element of the identity block of the resource ? or I should have created a single output exposing the all block ?
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cognitive_account
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.
@zioproto I think we need a try
here since it's possible to have an account without identity
block.
is it correct to create an output for each element of the identity block of the resource ? or I should have created a single output exposing the all block ?
Both works for me, I would say let's output the identity block:
output "cognitive_account_identity" {
...
value = try(azurerm_cognitive_account.this.identity[0], null)
}
outputs.tf
Outdated
|
||
output "principal_id" { | ||
description = "The Principal ID associated with this Managed Service Identity." | ||
value = azurerm_cognitive_account.this.identity[0].principal_id |
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.
@zioproto I think we need a try
here since it's possible to have an account without identity
block.
is it correct to create an output for each element of the identity block of the resource ? or I should have created a single output exposing the all block ?
Both works for me, I would say let's output the identity block:
output "cognitive_account_identity" {
...
value = try(azurerm_cognitive_account.this.identity[0], null)
}
@lonegunmanb please take a look again and merge if this is now OK. Thank you |
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 @zioproto , LGTM! 🚀
Describe your changes
Add the values from the
identity
block in the module outputhttps://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cognitive_account
Issue number
#84
Checklist before requesting a review
CHANGELOG.md
fileThanks for your cooperation!