Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

articulate/terraform-provider-validation

Repository files navigation

Terraform Provider Validation

DEPRECATED: Starting with Terraform 1.2, you can acomplish more complex validation using preconditions.

Terraform provides a way to add validation to variables, but you can't use other variables in this validation. This allows you to do complex validation on variables or resource outputs.

Using the provider

This provider has a single validation data source.

terraform {
  required_providers {
    validation = {
      source = "articulate/validation"
    }
  }
}

data "validation" "foo" {
  condition     = var.foo != "" || var.bar != ""
  error_message = "You must set foo or bar."
}

Requirements

Building The Provider

To build for the current system, run make build. If you want to build for all systems, run make all.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).

To compile the provider, run make build.

Run the full suite of Acceptance tests, run make testacc.