hashicorp / hashicorp/terraform-plugin-sdk

Multi-attribute validation

Open
#233 1 comment 24 reactions 0 assignees View on GitHub
enhancement terraform-plugin-framework
Dominant language
Go
Stars
485
Forks
244
Avg merge
19h 57m
Merged PRs (30d)
4

Description

## Problem Statement

Providers today are able to validate multiple attributes using `customdiff`'s `Validate*` functions:

https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/customdiff#ValidateValue
https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/customdiff#ValidateChange

However - as the package name suggests - this package is not meant to deal with such validation and using it for simple multi-attribute plan-time validation can feel awkward.

Such validation also doesn't run during `terraform validate`, but "later" during `terraform plan`.

## Examples

https://github.com/terraform-providers/terraform-provider-azurerm/blob/94cf18b287d634ee16aa5e37d3a73d3e8a356fa4/azurerm/resource_arm_cosmosdb_account.go#L384-L392

https://github.com/terraform-providers/terraform-provider-aws/blob/98b8b848ca94031b20c3e626c9d40484e3af80de/aws/resource_aws_lb_target_group.go#L684-L692

https://github.com/terraform-providers/terraform-provider-aws/issues/10963

## Proposal

TODO

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.