SAP / terraform-provider-btp

Terraform provider for SAP BTP
https://registry.terraform.io/providers/SAP/btp/latest
Apache License 2.0
83 stars 17 forks source link

[BUG]IDP does not exist with origin_key #553

Closed dineshkumarbcs closed 10 months ago

dineshkumarbcs commented 10 months ago

Is there an existing issue for this?

What version of the Terraform provider are you using?

0.6.0-beta2

What version of the Terraform CLI are you using?

1.6.3

What type of issue are you facing

bug report

Describe the bug

When we try to assign a role collection for a user along with custom IDP selection we are getting below error while apply. But plan is success.

Error: API Error Creating Resource Role Collection Assignment (Subaccount) │ │ with btp_subaccount_role_collection_assignment.subsrvc_admin[2], │ on main.tf line 35, in resource "btp_subaccount_role_collection_assignment" "subsrvc_admin": │ 35: resource "btp_subaccount_role_collection_assignment" "subsrvc_admin" { │ │ IDP does not exist with origin_key: custom-idp

Expected Behavior

Actual custom-IDP is available in the subaccount as trusted configuration. Main file as below.

resource "btp_subaccount_role_collection_assignment" "bas_admin" { count = length(var.roles) subaccount_id = var.subaccount_id role_collection_name = "Business_Application_Studio_Administrator" user_name = var.bas_admin[count.index] origin = custom-idp }

Assign multiple roles to a role collection on subaccount level

resource "btp_subaccount_role_collection_assignment" "sub_admin" { count = length(var.roles) subaccount_id = var.subaccount_id role_collection_name = "Subaccount Administrator" user_name = var.sub_admin[count.index] origin = custom-idp }

Steps To Reproduce

Terraform will perform the following actions:

btp_subaccount_role_collection_assignment.bas_admin[0] will be created

User's Role Collections

roles = ["Business_Application_Studio_Administrator", "Subaccount Administrator", "Subaccount Service Administrator"] bas_admin = ["ter1@basiscloudsolutions.com", "ter2@basiscloudsolutions.com", "ter4@basiscloudsolutions.com"] sub_admin = ["ter3@basiscloudsolutions.com","ter2@basiscloudsolutions.com","ter1@basiscloudsolutions.com"] subsrvc_admin = ["ter3@basiscloudsolutions.com", "ter4@basiscloudsolutions.com","ter2@basiscloudsolutions.com"]

Add screenshots to help explain your problem

Untitled

Additional context

Not sure whether I am performing something wrong.

dineshkumarbcs commented 10 months ago

My Bad. Seems we need to use this name.

image