Skip to content
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
5 changes: 5 additions & 0 deletions released/modules/roles/subaccount_role_app_id/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Module: modules - roles - App ID of a Role on subaccount level

## Content of setup

The module returns the application ID needed to create custom role collections.
20 changes: 20 additions & 0 deletions released/modules/roles/subaccount_role_app_id/role_app_id.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
terraform {
required_providers {
btp = {
source = "SAP/btp"
version = "~> 1.9.0"
}
}
}

data "btp_subaccount_roles" "all_roles" {
subaccount_id = var.subaccount_id
}


locals {
selected_role = [
for role in data.btp_subaccount_roles.all_roles.values : role
if role.name == var.role_name && role.role_template_name == var.role_template_name
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "role_app_id" {
value = local.selected_role[0].app_id
description = "The id of the application that provides the role template and the role."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
variable "subaccount_id" {
type = string
description = "The ID of the SAP BTP subaccount"
}

variable "role_name" {
type = string
description = "The name of the role"
}

variable "role_template_name" {
type = string
description = "The name of the role template."
}