https://github.com/tf-libsonnet/hashicorp-google
Jsonnet library for hashicorp/google Terraform provider.
https://github.com/tf-libsonnet/hashicorp-google
jsonnet terraform
Last synced: 8 months ago
JSON representation
Jsonnet library for hashicorp/google Terraform provider.
- Host: GitHub
- URL: https://github.com/tf-libsonnet/hashicorp-google
- Owner: tf-libsonnet
- License: mpl-2.0
- Created: 2022-12-16T17:34:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-05T22:48:37.000Z (over 2 years ago)
- Last Synced: 2024-02-05T23:47:21.240Z (over 2 years ago)
- Topics: jsonnet, terraform
- Language: Jsonnet
- Homepage:
- Size: 6.94 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
tf-libsonnet/hashicorp-google
Generate Terraform with Jsonnet
This repository contains [Jsonnet](https://jsonnet.org/) functions for generating resources and data sources for the
[hashicorp/google](https://registry.terraform.io/providers/hashicorp/google) Terraform provider.
Learn more about `tf.libsonnet` at [docs.tflibsonnet.com](https://docs.tflibsonnet.com/docs).
> **IMPORTANT**
>
> This library is generated using [tf-libsonnet/libgenerator](https://github.com/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**.
## Usage
Install the package using [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler):
```
jb install github.com/tf-libsonnet/hashicorp-google@main
# Or if you want to install a specific release
# jb install github.com/tf-libsonnet/hashicorp-google@v0.0.1
# Or if you want to install bindings for a specific provider major version series
# jb install github.com/tf-libsonnet/hashicorp-google/4.x@main
```
You can then import the package in your Jsonnet code:
```jsonnet
// main.tf.json.jsonnet
local google = import 'github.com/tf-libsonnet/hashicorp-google/main.libsonnet';
google.provider.new(project='my-project-id', region='us-central1', src='hashicorp/google')
+ google.service_account.new(
'default',
account_id='service_account_id',
display_name='Service Account',
)
```
This will generate the following Terraform JSON :
```json
{
"provider": {
"google": [
{
"project": "my-project-id",
"region": "us-central1"
}
]
},
"resource": {
"google_service_account": {
"default": {
"account_id": "service_account_id",
"display_name": "Service Account"
}
}
},
"terraform": {
"required_providers": {
"google": {
"source": "hashicorp/google"
}
}
}
}
```
Refer to the [reference docs](/docs/4.x/README.md) for a list of supported data sources and resources:
- [provider config](/docs/4.x/provider.md)
- [resources](/docs/4.x/README.md)
- [data sources](/docs/4.x/data/index.md)
## Support
If you have any questions about how to use the `tf.libsonnet` libraries, ask in the [Organization GitHub
Discussion](https://github.com/orgs/tf-libsonnet/discussions).
## Contributing
Refer to the [CONTRIBUTING.md](/CONTRIBUTING.md) document for information on how to contribute to `tf.libsonnet`.