terraform/builtin/providers/azurerm/validators.go

22 lines
510 B
Go

package azurerm
import (
"fmt"
"github.com/satori/uuid"
)
func validateJsonString(v interface{}, k string) (ws []string, errors []error) {
if _, err := normalizeJsonString(v); err != nil {
errors = append(errors, fmt.Errorf("%q contains an invalid JSON: %s", k, err))
}
return
}
func validateUUID(v interface{}, k string) (ws []string, errors []error) {
if _, err := uuid.FromString(v.(string)); err != nil {
errors = append(errors, fmt.Errorf("%q is an invalid UUUID: %s", k, err))
}
return
}