Generate Terraform with Jsonnet
This repository contains Jsonnet functions for generating resources and data sources for the DopplerHQ/doppler Terraform provider.
Learn more about tf.libsonnet
at docs.tflibsonnet.com.
IMPORTANT
This library is generated using tf-libsonnet/libgenerator. If you find an issue with the generated code, please file an issue in the
libgenerator
repository.If you would like to contribute a change, you may open a Pull Request with a suggested change, but please note that it will not be merged in until the necessary updates have been made to the generator.
Install the package using jsonnet-bundler:
jb install github.com/tf-libsonnet/dopplerhq-doppler@main
# Or if you want to install a specific release
# jb install github.com/tf-libsonnet/[email protected]
# Or if you want to install bindings for a specific provider major version series
# jb install github.com/tf-libsonnet/dopplerhq-doppler/1.x@main
You can then import the package in your Jsonnet code:
// main.tf.json.jsonnet
local tf = import 'github.com/tf-libsonnet/core/main.libsonnet';
local doppler = import 'github.com/tf-libsonnet/dopplerhq-doppler/main.libsonnet';
tf.withVariable('doppler_token', type='string')
+ doppler.provider.new(doppler_token='${var.doppler_token}', src='DopplerHQ/doppler')
+ doppler.secret.new('mysecret', project='backend', config='dev', name='MY_SECRET', value='some-secret-value')
This will generate the following Terraform JSON :
{
"provider": {
"doppler": [
{
"doppler_token": "${var.doppler_token}"
}
]
},
"resource": {
"doppler_secret": {
"mysecret": {
"config": "dev",
"name": "MY_SECRET",
"project": "backend",
"value": "some-secret-value"
}
}
},
"terraform": {
"required_providers": {
"doppler": {
"source": "DopplerHQ/doppler"
}
}
},
"variable": {
"doppler_token": {
"type": "string"
}
}
}
Refer to the reference docs for a list of supported data sources and resources:
If you have any questions about how to use the tf.libsonnet
libraries, ask in the Organization GitHub
Discussion.
Refer to the CONTRIBUTING.md document for information on how to contribute to tf.libsonnet
.