Onboarding to views

This feature is for Early Access Program customers only

Views are under active development and are only available to members of LaunchDarkly’s Early Access Program (EAP). To request access to this feature, contact your LaunchDarkly account manager.

Overview

This topic explains how to start using views. Views are resources to logically organize flags and flag access within your projects.

You can use views to group flags according to the teams in your organization and the features they work on. A flag can be linked to more than one view.

Benefits of using views

The benefits of using views include:

  • Consistency and security: Views allow you to organize and control access to sets of flags within a single project.
  • Reduced complexity: When you restrict access to sets of flags, members of your organization can focus on just the flags they work with. You can have multiple views per project, which means you can give multiple sets of developers access to some of the same flags if needed.
  • Improved scalability: Many organizations depend on the benefits of having all of their flags in a single project. For instance, using flag prerequisites requires all flags in a dependency chain to be in the same project. Using views means you can continue to use a single project, while limiting access to flags within that project.

Prerequisites

Before you can use views, you must contact your LaunchDarkly account manager and request to join the Early Access Program (EAP).

Members with an Admin, Owner, or Writer base role then automatically have access to creating and managing views. After you create the views you want in each project, you can create roles that assign access within the project based on each view.

Create views

We recommend having one member, such as an architect or tech lead, create views for a given project.

To create a new view and link flags to it:

  1. Click the project dropdown. The project menu appears.

  2. Select Project settings.

  3. Select Views. The Views list appears:

    The Views list in project settings.

    The Views list in project settings.
  4. Click Create view. The “Create view” dialog appears:

    The "Create view" dialog.

    The "Create view" dialog.
  5. Enter a unique, human-readable Name for the view.

  6. (Optional) Update the view Key. A suggested key auto-populates from the name you enter, but you can customize it if you wish.

  7. (Optional) Enter a Description.

  8. (Optional) Click Add tags. Enter a tag name to search for an existing tag or create a new one with that name.

  9. (Optional) Click Choose maintainer to set the maintainer of the view.

  10. Click Create & link flags. The “Link flags” dialog appears.

  11. Check the flags that you want to include in the view.

  12. Click Update linked flags.

You can also create a view and then link flags later. Follow steps 1-9 in the procedure above, and then click Create view & close.

Assign access based on views

We recommend assigning most members, such as software engineers and product managers, access to the flags they need based on the view that the flags are linked to.

To assign access to flags in a particular view, create a role with access to all actions on flags in that view and project.

Here’s an example:

Allow access to flags in the "frontend" view in the "default" project
1[
2 {
3 "effect": "allow",
4 "actions": ["*"],
5 "resources": ["proj/default:env/*:flag/*;view:frontend"]
6 }
7]

If you use views to restrict access to sets of flags, it may be helpful to require that flags are associated with a view. One way to enforce this is to create a role that allows the createFlag action only within a particular view.

Here’s an example:

Only allow flag creation in the "frontend" view in the "default" project
1[
2 {
3 "effect": "allow",
4 "actions": ["createFlag"],
5 "resources": ["proj/default:env/*:flag/*;view:frontend"]
6 }
7]

Use views from the flags list

From the Flags list in the LaunchDarkly UI, you can use the View menu to show only flags that are linked to selected views:

The "Flags" list, showing flags in one view, with the "View" menu called out.

The "Flags" list, showing flags in one view, with the "View" menu called out.

Manage views with Terraform

There is a beta version of the LaunchDarkly Terraform provider available to manage your views via Terraform. You can view documentation for the EAP-specific version of the provider on the preview feature branch of the repository.

To install and use the beta version of the Terraform provider:

  1. Download the executable for your system from the pre-release on the provider repository.

  2. Create a ~/.terraform.d/plugins folder.

  3. Copy the executable file to ~/.terraform.d/plugins.

  4. Create a /.terraformrc file and populate it with the following:

    .terraformrc file for beta version of the Terraform provider
    provider_installation {
    dev_overrides {
    "launchdarkly/launchdarkly" = "/Users/{USERPROFILE}/.terraform.d/plugins"
    }
    # Install all other providers directly from their origin provider registry as normal.
    # If this is omitted, terraform will only use the dev_overrides block.
    direct {}
    }
  5. (Optional) Run terraform init -reconfigure from the folder containing your Terraform configuration.

  6. Run terraform plan or terraform apply.

Provider executable security

You may need to confirm that you trust the provider executable depending on your security settings.

Next steps

For additional information on managing views, read Views. To learn more about creating roles, read Creating roles and policies.