1.0.18 • Published 4 years ago

@vt-cpolcini/ts-terraform-provider v1.0.18

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@ts-terraform/provider

This module provides access to Terraform providers directly, bypassing the terraform CLI. This is accomplished by launching and communicating with providers via their gRPC interface.

Example

Work-in-progress, you likely don't want to follow this exactly.

import {createProvider} from './provider'

async function run() {
  const provider = await createProvider('./.terraform/plugins/darwin_amd64/terraform-provider-aws_v2.65.0_x4', {
    debug: true,
  })

  await provider.configure({region: 'us-east-1'})

  const importRes = await provider.importResourceState('aws_iam_user', 'jacob')
  console.log(importRes)

  const readRes = await provider.readResource('aws_iam_user', importRes[0].state)
  console.log(readRes)

  if (readRes) {
    const planRes = await provider.planResourceChange(
      'aws_iam_user',
      readRes,
      {...readRes, tags: {hello: 'world'}},
      {private: importRes[0].private},
    )
    console.log(planRes)

    const applyRes = await provider.applyResourceChange('aws_iam_user', readRes, planRes.plannedState, {
      private: planRes.plannedPrivate,
    })
    console.log(applyRes)
  }

  await provider.shutdown()
}

run().catch((error: Error) => {
  console.error(error.stack)
  process.exit(1)
})
1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago