• Home
  • Integrations
  • SDKs
  • Guides
  • API docs
No results for ""
EXPAND ALL

EDIT ON GITHUB

Using tags

Read time: 1 minute
Last edited: May 13, 2022

Overview

This topic explains how custom roles use tags.

To learn more about how tags work within custom role policies, read Custom role concepts.

Adding tags to resources

You can add tags to resources in LaunchDarkly with the user interface (UI) or API. Tag names can include only letters, numbers, periods ., underscores _, and dashes -.

To learn more, read Other flag settings.

Using tags in custom role policies

In the LaunchDarkly UI, you can only specify tags in custom roles from the advanced editor.

For example, the below statement allows a member with this role to perform all actions at the flag level for flags tagged tag1 and tag2:

[
{
"effect": "allow",
"actions": ["*"],
"resources": ["proj/*:env/*:flag/*;tag1,tag2"]
}
]

You can also separate multiple tags for a resource with statements to create an "or" condition.

In the example below, the two statements allow member access to flags tagged either tag1 or tag2:

[
{
"effect": "allow",
"actions": ["*"],
"resources": ["proj/*:env/*:flag/*;tag1"]
},
{
"effect": "allow",
"actions": ["*"],
"resources": ["proj/*:env/*:flag/*;tag2"]
}
]

The following example gives a member access to all flags except those tagged either tag1 or tag2:

[
{
"effect": "allow",
"actions": ["*"],
"notResources": ["proj/*:env/*:flag/*;tag1"]
},
{
"effect": "allow",
"actions": ["*"],
"notResources": ["proj/*:env/*:flag/*;tag2"]
}
]