-
Notifications
You must be signed in to change notification settings - Fork 300
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
feat: allow data.azuread_application lookup using identifier_uri #1303
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.
Hi @JonasBak, thanks for this contribution, this would be a useful addition to the data source! Apologies for the delayed review.
If we are going to match any one identifier URI, then I think it would be better to add a new property identifier_uri
and leave the existing identifier_uris
as a computed attribute. My thinking here is that the returned application could have >1 identifier URI, which we would be saving to state, and this would create a discrepency between configuration and state. There is possibly no consequence to this at the moment, but this may throw an error in future versions of the provider RPC protocol (which is how the provider communicates with Terraform).
If you could rework this to add this additional property whilst keeping the existing attribute as-is, then I think this should be good to merge. The remainder of the implementation looks good to me.
Apologies again for the tardiness of this review. If you aren't in a position to make this change, just let me know and I'll happily pick this up whilst preserving your original commits.
Thanks!
Thanks for the review @manicminer, I rebased and added your suggestion 👍 data "azuread_application" "test" {
identifier_uri = "api://example-app"
} |
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 updating @JonasBak, this LGTM! 👍
This PR introduces a small feature to the
azuread_application
data source that allows us to get the application based on an identifying URI. This is a feature we would really like to use. It looks like this:I've implemented it in a way where you can provide a list of one element to the
identifier_uris
field, instead of introducing another field calledidentifier_uri
that is just a string, as I thought it might be easy to mix up the two fields, but would love some input on this. I added an error if more than one element is provided inidentifier_uris
.