terraform-provider-launchdarkly icon indicating copy to clipboard operation
terraform-provider-launchdarkly copied to clipboard

Missing support for Role Scopes in `launchdarkly_team_role_mapping`

Open ollaw opened this issue 3 months ago • 1 comments

Description It would be valuable to add support for LaunchDarkly Role Scopes, specifically in the launchdarkly_team_role_mapping resource.

Use Case Currently, when assigning roles to teams, the provider does not allow defining a scope that limits the role’s permissions to specific resources based on some specific attribute of the teams. As a result, it’s necessary to create multiple near-identical roles, each differing only by their target scope.

Adding support for role scopes would make it possible to define a single reusable role and map it to multiple teams, each with its own scoped context. This would greatly simplify management, reduce duplication, and ensure consistent permission definitions across teams.

Example

resource "launchdarkly_team_role_mapping" "teamX" {
  team_key  = "example-team-x"
  role_key  = "my-single-role"
  scope_key = {
        domain = "DomainX"
    }
}

resource "launchdarkly_team_role_mapping" "teamY" {
  team_key  = "example-team-y"
  role_key  = "my-single-role"
  scope_key = {
        domain = "DomainY"
    }
}

so that when creating a Role, its Policy can directly use the specified key

[
  {
    "resources": [
      "proj/*;${roleAttribute/domain}"
    ],
    "actions": [
      "viewProject"
    ],
    "effect": "allow"
  }
]

ollaw avatar Oct 16 '25 15:10 ollaw

Hi @ollaw ! Thank you so much for bringing this to our attention. I unfortunately cannot promise any sort of timeline at this time, but I've filed a ticket and feature request internally, and I will follow up here if it gets queued up. Please do continue to file issues whenever you encounter them, as even if we aren't able to address them immediately, they help us improve our offerings over time.

Have a great weekend!

sloloris avatar Oct 17 '25 09:10 sloloris