hashicorp / hashicorp/terraform-plugin-testing

New TestCheck helper `TestCheckResourceAttrPairWith`

Open
#187 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
68
Forks
22
Avg merge
2d 12h
Merged PRs (30d)
1

Description

### terraform-plugin-testing version

```
% go list -m github.com/hashicorp/terraform-plugin-testing/...
github.com/hashicorp/terraform-plugin-testing v1.5.1
```

### Use cases

It would be handy to have a new _TestCheck_ helper function that combines `TestCheckResourceAttrWith` and `TestCheckResourceAttrPair`, say `TestCheckResourceAttrPairWith`:

```go
type CheckResourceAttrPairWithFunc func(valueFirst, valueSecond string) error

func TestCheckResourceAttrPairWith(nameFirst, keyFirst, nameSecond, keySecond string, checkValuesFunc CheckResourceAttrPairWithFunc) TestCheckFunc {
...
}
```

The canonical use case for the Terraform AWS Provider is to test logical equivalence (rather than byte-for-byte equivalence) of a data source's IAM policy document and a resource's IAM policy document.

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.