terraform-provider-util

command module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 2 Imported by: 0

README

terraform-provider-util Build Status

terraform-provider-util provides some low-level utility functions.

Usage

Configure the util provider (e.g. providers.tf).

provider "util" {}

terraform {
  required_providers {
    ct = {
      source  = "poseidon/util"
      version = "0.2.2"
    }
  }
}

Perform a set of replacements on content with replace.

data "util_replace" "example" {
  content      = "hello world"
  replacements = {
    "/(h|H)ello/": "Hallo",
    "world": "Welt",
  }
}

# Hallo Welt
output "example" {
  value = data.ct_replace.example.replaced
}

Store a content value that persists in state until changed to a non-empty value.

resource "util_register" "example" {
  content = "a1b2c3"
}

Later, the register's content may be updated, but empty values (null or "") are ignored.

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

Development

Binary

To develop the provider plugin locally, build an executable with Go v1.16+.

make

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL