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

feat(azuread_application): random id for oauth2_permission_scope #2027

Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ azuread_applications = {
id = "d4c3605a-b327-35c5-f04d-77f7fcdd4995"
type = "Admin"
value = "app"
},
{
admin_consent_description = "Allow to administer app2."
admin_consent_display_name = "Administer app2"
enabled = true
type = "Admin"
value = "app2"
}
]
}
Expand Down
9 changes: 8 additions & 1 deletion modules/azuread/applications_v1/azuread_application.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ resource "azuread_application" "app" {
content {
admin_consent_description = oauth2_permission_scope.value.admin_consent_description
admin_consent_display_name = oauth2_permission_scope.value.admin_consent_display_name
id = oauth2_permission_scope.value.id
id = try(oauth2_permission_scope.value.id, random_uuid.oauth2_permission_scopes[oauth2_permission_scope.key].id)
enabled = try(oauth2_permission_scope.value.enabled, null)
type = try(oauth2_permission_scope.value.type, null)
user_consent_description = try(oauth2_permission_scope.value.user_consent_description, null)
Expand Down Expand Up @@ -131,3 +131,10 @@ resource "random_uuid" "app_role_id" {
if try(value.id, null) == null
}
}

resource "random_uuid" "oauth2_permission_scopes" {
for_each = {
for key, value in try(var.settings.api.oauth2_permission_scopes, {}) : key => value
if try(value.id, null) == null
}
}