https://github.com/poseidon/terraform-provider-util
Terraform provider for special utilities
https://github.com/poseidon/terraform-provider-util
terraform terraform-provider
Last synced: 25 days ago
JSON representation
Terraform provider for special utilities
- Host: GitHub
- URL: https://github.com/poseidon/terraform-provider-util
- Owner: poseidon
- License: mit
- Created: 2021-09-26T18:15:46.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2026-05-24T05:25:45.000Z (25 days ago)
- Last Synced: 2026-05-24T06:36:51.974Z (25 days ago)
- Topics: terraform, terraform-provider
- Language: Go
- Homepage: https://registry.terraform.io/providers/poseidon/util/latest/docs
- Size: 189 KB
- Stars: 4
- Watchers: 0
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
- Dco: DCO
Awesome Lists containing this project
README
# terraform-provider-util
[](https://pkg.go.dev/github.com/poseidon/terraform-provider-util)
[](https://github.com/poseidon/terraform-provider-util/actions/workflows/test.yaml?query=branch%3Amain)

[](https://github.com/sponsors/poseidon)
[](https://fosstodon.org/@poseidon)
`terraform-provider-util` provides some low-level utility functions.
## Usage
Configure the `util` provider (e.g. `providers.tf`).
```hcl
provider "util" {}
terraform {
required_providers {
util = {
source = "poseidon/util"
version = "0.4.0"
}
}
}
```
Perform a set of replacements on content with `replace`.
```hcl
data "util_replace" "example" {
content = "hello world"
replacements = {
"/(h|H)ello/": "Hallo",
"world": "Welt",
}
}
# Hallo Welt
output "example" {
value = data.ct_replace.example.replaced
}
```
Convert a Kubernetes Service Account public key into a JWKS document for OIDC discovery.
```hcl
data "util_jwks" "cluster" {
public_key = module.cluster.service_account_public_key
}
output "jwks" {
value = data.util_jwks.cluster.jwks
}
```
Store a content value that persists in state until changed to a non-empty value.
```tf
resource "util_register" "example" {
content = "a1b2c3"
}
```
Later, the register's content may be updated, but empty values (`null` or `""`) are ignored.
```tf
resource "util_register" "example" {
content = null
}
output "sha" {
value = util_register.example.value # "a1b2c3"
}
```
Run `terraform init` to ensure plugin version requirements are met.
```
$ terraform init
```
## Requirements
* Terraform v0.13+ [installed](https://www.terraform.io/downloads.html)
## Development
### Binary
To develop the provider plugin locally, build an executable with Go v1.18+.
```
make
```