Overview
l4 tags reads your organization's tag keys, both the provider keys from your AWS and GCP bills and the virtual keys you defined. It also manages virtual keys from YAML files you keep in version control. Virtual tags explains how a virtual key picks a value for each cost.
l4 tags <command> [flags]Subcommands
| Command | Purpose | Scope |
|---|---|---|
list | Every key, with its values, resources and spend | read |
show | One key: its rules in order, spend per value, unallocated spend | read |
coverage | Tagged share of spend and resources, with and without virtual tags | read |
resources | Resources carrying a key, and the value each one holds | read |
costs | Spend per value of a key | read |
preview | Dry run of a tag file. Stores nothing | read |
apply | Create or replace a virtual key from a tag file | read-write |
delete | Delete a virtual key | read-write |
Naming a key
show, resources, costs and delete take a <key> argument: a key ID or a key name. l4 tags list prints both. A vtk_ ID belongs to a virtual key and a ptk_ ID to a provider key. A virtual key can share its name with a provider key, and the ID then picks the one you mean.
Two commands narrow that. delete refuses a ptk_ ID, since a provider tag comes from the bill. costs takes a name or a vtk_ ID and reads a ptk_ ID as a literal tag key, which matches nothing.
When the argument is a name, the CLI resolves it against the key list before making the real request, so a name nobody holds fails locally with no tag key named ... rather than a 404 from the API.
Dates
--start and --end take YYYY-MM-DD and go together. Without them, a command reads the last 30 complete days. l4 tags costs is the exception, and reads the current month to date.
Global flags (--json, --jq, --template, --quiet) apply to every subcommand. See CLI overview.
Examples
l4 tags list --origin virtual
l4 tags show Teams
l4 tags coverage --provider aws
l4 tags preview -f teams.yaml
l4 tags apply -f teams.yaml --dry-runRelated
- Virtual tags: evaluation order, worked examples, dimensions, operators and limits
l4 costs: the cost breakdown, with provider tag filters- Output formats: what
--json,--jqand--templateemit - Tags API reference: the endpoints underneath