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.
- To create a Resource, open the Projects tab and select the required project.
- In the Blueprint tab, locate the Add Resource Panel on right.
- Search for and select the required resource type.
- Mention the Flavor and Resource Name.
- 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.
- Open the Projects and select the required Project.
- Select the Blueprint tab to access the Resources graph.
- Locate the resource you want to modify.
- If you're in Graph mode, click on the resource and go to Configure.
- If you're in Table mode, click on the resource name and select the Configurations tab to access the JSON.
- 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. - 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 myprojectA 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 myprojectraptor apply resource takes the same bulk selectors, so --type with --set changes one
field across every resource of a kind in a single commit.
Infrastructure Blueprint
The blueprint is the model of your infrastructure in Facets: a Git-backed graph of resources. Import your existing running infrastructure with Praxis, or build it fresh in the Blueprint Designer.
Types of Resources
Compare the three Facets resource types: normal resources deployed per environment, inherited resources shared across environments, and provided externals.