1.0.18 • Published 2 years ago
@vt-cpolcini/ts-terraform-provider v1.0.18
@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
2 years ago
1.0.17
2 years ago
1.0.16
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago