hashicorp / hashicorp/terraform-plugin-sdk

Allow ConflictsWith, ExactlyOneOf, and AtLeastOneOf to work in Lists

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

Description

### Use-cases

Currently `ConflictsWith`, `ExactlyOneOf` or `AtLeastOneOf` are set at the attribute level, which means we can't set it on a list of if we have a list of objects, and each object has a list of attributes that's `AtLeastOneOf`. We don't know the length of the list and there is no way to differentiate object[0] from object[1] with what is conflicting.

### Proposal

We need to move `ConflictsWith`, `ExactlyOneOf` and `AtLeastOneOf` to the resource level to be able to determine which child fields are conflicting.

Contributor guide

Open the contributing guide

Research direction

The issue does not name files, tests, or an entry point. Start by tracing how ConflictsWith, ExactlyOneOf, and AtLeastOneOf are currently represented and evaluated, then determine the resource-level design needed for nested lists. Done means these constraints can distinguish fields belonging to separate list objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, terraform
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.