mirror of
https://github.com/hanzokms/terraform-provider.git
synced 2026-10-30 20:29:45 +00:00
18 lines
445 B
Go
18 lines
445 B
Go
package terraform
|
|
|
|
import (
|
|
"regexp"
|
|
|
|
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
|
|
)
|
|
|
|
var SlugRegexValidator = stringvalidator.RegexMatches(
|
|
regexp.MustCompile(`^[a-z0-9_-]*$`),
|
|
"invalid slug, slugs must be lowercase alphanumeric characters and hyphens only (example-slug-1)",
|
|
)
|
|
|
|
var JsonStringValidator = stringvalidator.RegexMatches(
|
|
regexp.MustCompile(`^[\[{].*[\]}]$`),
|
|
"must be a valid JSON string",
|
|
)
|