Skip to content

Commit

Permalink
added example to terraform state list documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
FloxD committed Jun 24, 2024
1 parent 21a695e commit 278f99e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions website/docs/cli/commands/state/list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ aws_instance.bar[0]
aws_instance.bar[1]
```

## Example: Filtering with Index

This example will show you how to filter when your filter includes an Index:

```
$ terraform state list 'foo[0].bar'
foo[0].bar.lorem
foo[0].bar.ipsum
```

When there's an index in the filter then you have to use single quotes.

## Example: Filtering by Module

This example will list resources in the given module and any submodules:
Expand Down

0 comments on commit 278f99e

Please sign in to comment.