Documentation ¶
Index ¶
- func CheckIfResourceNestedAttributeContainsResourceAttribute(firstResourceName string, firstResourceKeys []string, ...) resource.TestCheckFunc
- func Resource(address string, checks ...AttributeCheck) resource.TestCheckFunc
- type AttributeCheck
- func Attribute(name string, check ValueCheck) AttributeCheck
- func AttributeNotPresent(name string) AttributeCheck
- func CheckInList(checks ...AttributeCheck) AttributeCheck
- func Nested(attributeName string, check AttributeCheck) AttributeCheck
- func SetContains(name string, values ...string) AttributeCheck
- func SetDoesNotContain(name string, values ...string) AttributeCheck
- func SetEquals(name string, values ...string) AttributeCheck
- type ValueCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfResourceNestedAttributeContainsResourceAttribute ¶
func CheckIfResourceNestedAttributeContainsResourceAttribute(firstResourceName string, firstResourceKeys []string, secondResourceName string, secondResourceKey string) resource.TestCheckFunc
CheckIfResourceNestedAttributeContainsResourceAttribute runs a value check between the first resource and second resource. The first resource attribute is assumed to have a only a single level of depth. The second resource attribute is assumed to be a regular attribute. TODO: - refactor this logic into the Resource method - add support in the Attribute method to add special values (*) in the name? - better support for collection testing?
func Resource ¶
func Resource(address string, checks ...AttributeCheck) resource.TestCheckFunc
Resource runs an arbitrary number of checks on a resource. The resource is assumed to be in the root module.
Types ¶
type AttributeCheck ¶
AttributeCheck is a check on a single attribute.
func Attribute ¶
func Attribute(name string, check ValueCheck) AttributeCheck
Attribute runs a value check function against an attribute passed by name.
func AttributeNotPresent ¶
func AttributeNotPresent(name string) AttributeCheck
AttributeNotPresent ensures that an attribute is not set on the resource.
func CheckInList ¶ added in v1.1.5
func CheckInList(checks ...AttributeCheck) AttributeCheck
CheckInList will group attributes by index and run the check on each group. If check passes for a single group, the check will pass.
func Nested ¶ added in v1.1.5
func Nested(attributeName string, check AttributeCheck) AttributeCheck
Nested will scope down attribute checks to a nested attribute. The nested attributes will be stripped of the attributeName prefix.
func SetContains ¶ added in v0.1.16
func SetContains(name string, values ...string) AttributeCheck
SetContains checks the set contains all specified values
func SetDoesNotContain ¶ added in v0.1.16
func SetDoesNotContain(name string, values ...string) AttributeCheck
SetDoesNotContain checks the set does not contain any of the specified values
func SetEquals ¶
func SetEquals(name string, values ...string) AttributeCheck
SetEquals checks for complete set equality.
type ValueCheck ¶
ValueCheck is a check on an attribute value.
func Equals ¶
func Equals(expected string) ValueCheck
Equals checks for equality against the expected value.
func IsNotEmpty ¶
func IsNotEmpty() ValueCheck
IsNotEmpty checks that the expected value is not empty.
func NotEquals ¶ added in v1.13.1
func NotEquals(unexpected string) ValueCheck
NotEquals checks for inequality against the unexpected value.