-
Notifications
You must be signed in to change notification settings - Fork 5
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
[BUG] Cannot assign new (non-existing) user to org_role on CF - BTP #108
Comments
For the cf-client/terraform provider to be able to add a user to an organisation/space in CF in BTP, the user must log in to the cf API at least once. The An An RFC to support this feature is being discussed and can be followed here. |
@eshirke Aa you using Cloud Foundry on SAP Business Technology Platform (SAP BTP) this is probably a known limitation with regards to the handling of new Cloud Foundry org user. If the user is brand-new, meaning that the user was never before assigned to a Cloud Foundry org in this BTP region, you will only be able to add the user to an org role via SAP BTP cockpit. The assignment is not possible via CF CLI or the Cloud Foundry provider. Once the user was once added to a CloudFoundry organization in a region via SAP BTP cockpit (which internally triggers the onboarding to CF UAA), you can add the user to other orgs via CF CLI or the Terraform provider. You can test this be removing the user you just manually added and add it agian via Terraform which should work. This limitation should be removed in the future, but there is no delivery date up to now. |
Thanks for details, can we have the links or reference details where we have listed down such limitations for Cloud Foundry on SAP Business Technology Platform (SAP BTP) management via terraform provider. |
Is there an existing issue for this?
What version of the Terraform provider are you using?
1.2.0
What version of the Terraform CLI are you using?
1.7.4
What CF API version are you using?
No response
What type of issue are you facing
bug report
Describe the bug
Could not register Role with user ID : executing POST request for /v3/roles failed: cfclient error (CF-UnprocessableEntity|10008)
Expected Behavior
Issue:
Not able to add new users as org_managers via terraform code, getting this error where as same user is getting added via BTP Cloud foundry portal manually.
Error Details:
Error: API Error Registering Role
with module.xxx-global-nfe-drc-nonprod-cloudfoundry.cloudfoundry_org_role.org_users["[email protected]"]
on modules/cloudfoundry/main.tf line 10, in resource "cloudfoundry_org_role" "org_users":
resource "cloudfoundry_org_role" "org_users" {
Could not register Role with user ID : executing POST request for /v3/roles failed: cfclient error (CF-UnprocessableEntity|10008): No user exists with the username '[email protected]'.
Terraform Code:
resource "cloudfoundry_org_role" "org_managers" {
for_each = toset(var.org_managers)
org = var.cloudfoundry_org_id
type = "organization_manager"
username = each.value
}
resource "cloudfoundry_org_role" "org_users" {
for_each = toset(var.org_managers)
org = var.cloudfoundry_org_id
type = "organization_user"
username = each.value
}
Steps To Reproduce
No response
Your Terraform Configuration
Roles
No response
Add screenshots to help explain your problem
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: