Resource Actions

Resource Actions in Facets let teams run on-demand, containerised operations on resources as governed self-service workflows, recorded as Action Runs.

Resource Actions run on-demand operational tasks against a resource. Under the hood an Action is a Tekton Task made of one or more sequential containerised steps, with a credential-setup step injected automatically, and each run is recorded as an immutable Action Run.

Platform or DevOps engineers define custom actions on a module; developers then run them on any resource instance of that module, with no ticket and no dependency on the platform team.

Why use resource actions

Operational tasks like snapshotting a database, clearing a Redis cache, running a compliance scan, restarting a pod, or executing a migration are usually manual, error-prone, or handled through a ticket to the platform team, which is a bottleneck. Resource Actions turn them into governed, self-service workflows developers can run themselves.

Discovering and running an action

Using prompt

Restart the service/agent deployment in dev.

or

Using command

raptor get actions service/NAME -p PROJECT -e ENVIRONMENT
raptor trigger action service/NAME -p PROJECT -e ENVIRONMENT -a ACTION_NAME

The first lists the actions defined for that resource, which is how you find the name to pass to the second. Actions that take input use --param KEY=VALUE, repeatable, and --array-param KEY=v1,v2 for list parameters. Add -w to block until the run reaches a terminal status. -f runs.yaml submits several runs at once instead.

New to the CLI? Install it first.

  1. Open a resource (for example an aws-rds instance) within an environment.
  2. Select its Actions tab. This lists every action defined for that resource type, with descriptions.
  3. Click Run on the action you want.
  4. Fill in any input parameters in the modal, then click Execute to start the Action Run.

Monitoring action runs

Using prompt

Show me the recent action runs on service/agent in dev.

or

Using command

raptor get action-runs service/NAME -p PROJECT -e ENVIRONMENT
raptor get action-run-logs service/NAME RUN_ID -p PROJECT -e ENVIRONMENT -a ACTION_NAME

The first is the run history, and --action narrows it to one action. The second returns one run's logs, with --follow to stream a run still in progress. Where an action produces a file, raptor get action-run-download retrieves it.

New to the CLI? Install it first.

  1. On the resource, select the Action Runs tab for a historical log of every execution.
  2. Open a run to see its details: real-time status, start and end timestamps, who triggered it, and logs.

Actions provided by Facets

  • Scale up or scale down a service resource instance
  • Rollout restart of a service resource instance
  • Helm history of a helm resource instance
  • Helm rollback of a helm resource instance

More provided actions are on the way. To define your own, see Defining module resource actions.