Adding & Editing a Resource

Step-by-step guide to adding, editing, and configuring resources in the Facets Blueprint tab using graph mode, table mode, and the JSON editor.

Create, edit, and delete resources in the Blueprint tab. A new resource starts with default sample values you can change afterwards.

Add a resource

Using prompt

Add a postgres called main-db to myproject.

or

Using command

# Which types and flavors this project's project type allows
raptor get resource-types -p myproject

raptor apply resource postgres/aws/1.0 -n main-db -p myproject

--dry-run validates and prints the resource without applying it.

New to the CLI? Install it first.

  1. To create a Resource, open the Projects tab and select the required project.
  2. In the Blueprint tab, locate the Add Resource Panel on right.
  3. Search for and select the required resource type.
  4. Mention the Flavor and Resource Name.
  5. Click Add.

You have successfully added a new resource in the Blueprint.

Interactive walkthrough

Edit a resource

Using prompt

Set the instance size on postgres/main-db to db.t3.medium in myproject.

or

Using command

# One field at a time, dot-notation, type inferred
raptor apply resource postgres/main-db -p myproject --set spec.size.instance=db.t3.medium

# --set-string skips type inference, --set-json takes an explicit JSON value
raptor apply resource service/api -p myproject --set-string spec.env.PORT=8080
raptor apply resource service/api -p myproject --set-json spec.replicas='{"min":2,"max":6}'

# Remove a field
raptor apply resource service/api -p myproject --unset spec.env.OLD_FLAG

--spec-file replaces the whole spec rather than merging, so anything absent from the file is dropped and the command asks before doing it. -m sets the git commit message for the change.

New to the CLI? Install it first.

  1. Open the Projects and select the required Project.
  2. Select the Blueprint tab to access the Resources graph.
  3. Locate the resource you want to modify.
    1. If you're in Graph mode, click on the resource and go to Configure.
    2. If you're in Table mode, click on the resource name and select the Configurations tab to access the JSON.
  4. In the page that appears, make the necessary changes to the configuration settings.
    Note: From the Resource Reference column, you can select resources alongside their interfaces or attributes to display references dynamically. This information is copy-ready for convenient use.
  5. Click Save Changes to save the updated configuration.

You have successfully edited a Resource in Facets.

Rename and delete

Using prompt

Rename service/old-api to service/new-api in myproject.

or

Using command

raptor rename resource -p myproject service/old-api service/new-api

raptor delete resource service/api postgres/main-db -p myproject

A rename lists everything naming the old resource first, whether through a ${TYPE.NAME.out...} expression or an input wiring, and the server rewrites all of them in the same commit. Deleting several resources is one atomic call, so if it fails nothing is removed.

New to the CLI? Install it first.

Both are on the resource's drop-down in the Blueprint tab.

You can also disable a resource to keep it in the blueprint but leave it out of deployments, then re-enable it later, from the same drop-down.

Work on many resources at once

The Resources footer offers Bulk Delete and Bulk Attach to Resource Groups for selected resources. The same two operations from the terminal:

# Every resource of one kind, or the TYPE/NAME entries listed in a file
raptor delete resource --type pubsub -p myproject
raptor delete resource --resources-file resources.txt -p myproject

# Attach a set of resources to a group
raptor attach resource service/api postgres/main-db --group production-resources -p myproject
raptor attach resource --type pubsub --group production-resources -p myproject

raptor apply resource takes the same bulk selectors, so --type with --set changes one field across every resource of a kind in a single commit.