CLI

l4 alerts update

Change a cost alert's name, rule, source, recipients or Slack channels from a JSON file of only the fields to change.

l4 alerts update changes a cost alert. It sends only the fields its file names, and leaves every other field as it is.

l4 alerts update <id> --file <path|-> [--yes]

The change file

The file takes any of name, params, source_id, recipients and slack_channel_ids, in the shapes l4 alerts create describes.

  • params replaces the whole rule. To move one threshold, send the rule back with that figure changed.
  • recipients and slack_channel_ids replace the list they name. An empty slack_channel_ids takes every channel off.
  • The CLI refuses a file that names no field with ... changes nothing, before it sends anything.

Raise a monthly budget to 50,000, keeping the rest of the rule:

l4 alerts get <id> --json \
  | jq '{params: (.data.params | .budget = 50000)}' \
  | l4 alerts update <id> --file - --yes

To pause an alert, use l4 alerts pause.

Flags

FlagDescription
-f, --fileThe change file, or - to read it from stdin. Required
-y, --yesSkip the confirmation prompt

Confirmation

At a terminal, the command asks Change cost alert <id>? [y/N]. Anything other than y or yes aborts, prints Aborted., and exits 0 without calling the API. In a pipe or a script, where stdout is not a terminal, it changes the alert without asking. With --file - at a terminal, pass --yes, for the reason create gives.

Requires a read-write key

A read-only key fails with exit 1 and permission denied. See CLI authentication.

Output

A success line, then the alert as it now reads, in the layout of l4 alerts get. With --json, the alert as the API returns it.

Errors

ExitSymptomCause
1... is not a cost alert idThe id is not a UUID
1... changes nothingThe file is an empty object
1403 permission deniedThe key is read-only
1404No alert has that id in your organization
1422 with a reasonThe API refused the change for a reason create lists, or for a field set to null

On this page

Ask the FinOps Agent about your cloud spend