> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infraudit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# infraudit resource — cloud resource list and inspection

> infraudit resource list, get, and search — filter discovered resources by provider, type, and region. Key flags: --provider, --type, --region, --status.

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:**

```bash theme={null}
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:

```bash theme={null}
# 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:**

```bash theme={null}
infraudit resource get <resource-id>
```

Example:

```bash theme={null}
infraudit resource get 42
```

Example output (YAML):

```bash theme={null}
infraudit resource get 42 -o yaml
```

```yaml theme={null}
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:**

```bash theme={null}
infraudit resource search <query>
```

Example:

```bash theme={null}
infraudit resource search "web-server"
```

<Note>
  `resource search` searches across resource names and metadata. For precise filtering by type or region, use `resource list` with the appropriate flags.
</Note>

## `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:**

```bash theme={null}
infraudit resource delete <resource-id>
```

Example:

```bash theme={null}
infraudit resource delete 42
```

<Warning>
  Deleted records are removed from InfraAudit and will not appear in future scans unless a provider sync rediscovers them.
</Warning>
