The resource command group lets you list, filter, and inspect cloud resources that InfraAudit discovered during provider syncs. Resources are not modified by any command in this group.
resource list
List all discovered resources with optional filters.
Synopsis:
infraudit resource list [flags]
| Flag | Description |
|---|
--provider | Filter by provider ID |
--type | Filter by resource type (e.g. ec2, s3, rds, lambda) |
--region | Filter by cloud region (e.g. us-east-1, eu-west-1) |
--status | Filter by status: active, stopped, or deleted |
Examples:
# List all resources
infraudit resource list
# Filter by provider
infraudit resource list --provider 1
# Filter by type and region
infraudit resource list --type ec2 --region us-east-1
# Output as JSON for scripting
infraudit resource list -o json
# Pipe to jq to extract names
infraudit resource list -o json | jq '.[].name'
Example output:
ID NAME TYPE REGION STATUS PROVIDER
-- ---- ---- ------ ------ --------
1 web-server-01 ec2 us-east-1 active 1
2 api-gateway lambda us-west-2 active 1
3 data-bucket s3 us-east-1 active 1
resource get
Show detailed information about a specific resource, including its metadata, tags, and any associated findings.
Synopsis:
infraudit resource get <resource-id>
Example:
infraudit resource get 42
Example output (YAML):
infraudit resource get 42 -o yaml
id: 42
name: web-server-01
type: ec2
region: us-east-1
status: active
provider_id: 1
tags:
env: production
team: platform
resource search
Search resources by name or other attributes using a free-text query.
Synopsis:
infraudit resource search <query>
Example:
infraudit resource search "web-server"
resource search searches across resource names and metadata. For precise filtering by type or region, use resource list with the appropriate flags.
resource delete
Remove a resource record from InfraAudit. This does not delete the actual cloud resource — it only removes the record from the InfraAudit database.
Synopsis:
infraudit resource delete <resource-id>
Example:
infraudit resource delete 42
Deleted records are removed from InfraAudit and will not appear in future scans unless a provider sync rediscovers them.