https://github.com/conorgil/tfstate
https://github.com/conorgil/tfstate
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/conorgil/tfstate
- Owner: conorgil
- License: mit
- Created: 2016-10-11T17:33:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-11T01:42:21.000Z (over 9 years ago)
- Last Synced: 2025-02-05T18:47:33.222Z (over 1 year ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tfstate - Easily get output from terraform state
`tfstate` is a convenience tool that can output terraform output as a JSON
object from any supplied terraform state. The terraform state references are
loaded using a uri format.
## Key Features
* Supports Remote State (S3 only at the moment)
* Uses a default 60 second cache to reduce network overhead and increase speed of query
## CLI Usage
Get the terraform output for the state stored in an s3 bucket `mybucket` and the
path `infrastructure/production`:
$ tfstate --state-uri=s3://mybucket/infrastructure/production
## Library Usage
Usage in a library is also equally as simple:
import tfstate
state_uri = "s3://mybucket/infrastructure/production"
output = tfstate.get(state_uri)
The `output` object is simply a dictionary of the terraform output