Skip to main content
TerraformRemoteState allows you to read output values from a remote Terraform state file.

Methods

get()

get(name: string): any
Returns a remote state output value.

getString()

getString(name: string): string
Returns a remote state output value as a string.

getNumber()

getNumber(name: string): number
Returns a remote state output value as a number.

getList()

getList(name: string): string[]
Returns a remote state output value as a list of strings.

getBoolean()

getBoolean(name: string): boolean
Returns a remote state output value as a boolean.

Remote State Classes

Each backend has a corresponding remote state class:

DataTerraformRemoteStateLocal

new DataTerraformRemoteStateLocal(scope: Construct, id: string, config: LocalBackendConfig)

DataTerraformRemoteStateS3

new DataTerraformRemoteStateS3(scope: Construct, id: string, config: S3BackendConfig)

DataTerraformRemoteStateGcs

new DataTerraformRemoteStateGcs(scope: Construct, id: string, config: GcsBackendConfig)

DataTerraformRemoteStateRemote

new DataTerraformRemoteStateRemote(scope: Construct, id: string, config: RemoteBackendConfig)

DataTerraformRemoteStateCloud

new DataTerraformRemoteStateCloud(scope: Construct, id: string, config: CloudBackendConfig)