Skip to content

Missing support for Role Scopes in launchdarkly_team_role_mapping #360

@ollaw

Description

@ollaw

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"
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions