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

fix(azure): use object id instead of principal id #71

Merged
merged 1 commit into from
Sep 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions azure/modules/ad_application/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ resource "azurerm_role_assignment" "grant_reader_role_to_subscriptions" {
count = var.create ? length(data.azurerm_subscriptions.available.subscriptions) : 0
scope = "/subscriptions/${data.azurerm_subscriptions.available.subscriptions[count.index].subscription_id}"

principal_id = azuread_service_principal.lacework[0].id
principal_id = local.service_principal_id
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just using the service principal id defined above in the locals {} block.

role_definition_name = "Reader"
}

Expand All @@ -109,7 +109,7 @@ resource "random_password" "generator" {

resource "azuread_application_password" "client_secret" {
count = var.create ? 1 : 0
application_object_id = local.service_principal_id
application_object_id = azuread_application.lacework[count.index].object_id
value = random_password.generator[count.index].result
end_date = "2299-12-31T01:02:03Z"
depends_on = [azuread_service_principal.lacework]
Expand Down