terraform-remote-state
v1.0.6
Published
Fetch remote terraform state from S3
Downloads
10
Readme
Terraform Remote State
Micro library to fetch terraform state (right now only from S3 bucket)
Installing
Node.js (JavaScript/TypeScript)
To use from JavaScript or TypeScript in Node.js, install using either npm:
$ npm install terraform-remote-stateor yarn:
$ yarn add terraform-remote-stateExamples
The following program will read a Terraform state file stored in S3 from staging workspace:
const tf = require('terraform-remote-state')
const state = await tf.s3RemoteState("staging", {
bucket: "pulumi-terraform-state-test",
key: "test/terraform.tfstate",
region: "us-west-2",
profile: 'terraform-state'
});
const restApiId = state.getOutput("restapi_id");