Resource Groups

Use Resource Groups in Facets to bundle related services, databases, and caches for team-based access control, selective releases, and bulk operations.

Resource Groups are a key feature for organizing and managing resources within the Facets platform, allowing for better control, collaboration, and access management.

  • They provide a structured approach to organizing and managing resources.
  • They allow you to bundle related resources together, such as services, databases, and caches, simplifying resource management and aligning with your team and pod structures.

Use Cases for Resource Groups

  • Team-Based Access Control: Create Resource Groups for each team or department, granting access only to the resources they need.
  • Segmentation in Release: Use this segmentation to release dependent resources together while performing selective release.
  • Project-Based Organization: Group resources based on the Projects to manage them separately.
  • Perform Bulk Operations: Filter out resources in the resource center based on resource groups to perform bulk operations like Enable and Disable.

How to Create a Resource Group

To create a Resource Group:

Using prompt

Create a resource group called production-resources.
Put service/api and postgres/main-db in production-resources.

or

Using command

raptor create resource-group --name production-resources

Resources are identified as TYPE/NAME, for example service/api or postgres/main-db.

# Attach specific resources
raptor attach resource service/api postgres/main-db --group production-resources -p myproject

# Attach every resource of one kind in the project
raptor attach resource --type pubsub --group production-resources -p myproject

# Attach the newline-delimited TYPE/NAME entries listed in a file
raptor attach resource --resources-file resources.txt --group production-resources -p myproject

More of what the Praxis CLI can do here is further down this page.

New to the CLI? Install it first.

  1. Navigate to Settings > Resource Groups from the left pane.
    This page lists all the Resource Groups created within the Facets Control Plane.
  2. Click Create Resource Group.
  3. In the Add Resource Group drawer, enter the Resource Group Name.
    Note: The name must be between 3 and 15 characters, cannot contain whitespace, and must be unique within the Control Plane.
  4. Click Save Changes.

The group is created empty. To put resources into it, open the group, click Update Resources, select the Project, and then select the resources you want in the group.

A resource can also be put into a group at the moment you create it, from the resource creation form, without coming back to this screen afterwards.

Interactive walkthrough:

How to Manage Access to Resource Groups

  • Assigning User Groups: Resource Groups can be assigned to user groups, ensuring that only users within those groups have access to the specified resources.

Other things you can do with the Praxis CLI

The rest of what you can do to a group, from the Praxis CLI.

List and inspect

# List every group. Aliases: resourcegroups, rg
raptor get resource-groups

# List only the groups the current user can access
raptor get resource-groups --me

# Inspect one group
raptor get resource-group GROUP_ID -o json

Rename and delete

raptor set resource-group GROUP_ID --name new-name

raptor delete resource-group production-resources
raptor delete resource-group production-resources --yes

Delete asks for confirmation. In a non-interactive context with no TTY it refuses instead of failing silently, so scripts and CI jobs have to pass --yes.

Detach resources

raptor detach resource service/api --group production-resources -p myproject

Three properties of these commands are worth knowing:

  • Group names are unique. On delete, attach, and detach, the group can be identified by its ID or by its name, so a name works wherever an ID does.
  • Attaching is additive and idempotent. A resource's other group memberships are preserved and a resource already in the group is left unchanged, so one resource can sit in several groups.
  • Attach and detach are project-scoped, so -p is required on both. Resource-group membership is a Control Plane (RBAC) construct and is independent of blueprint branches and PRs.