0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-05 21:43:59 +00:00
terraform-provider-proxmox/fwprovider/validators/devices.go
Pavel Boldyrev b779317dba
create and read back basic cloud-init
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-09-22 21:34:17 -04:00

23 lines
698 B
Go

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package validators
import (
"regexp"
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
)
// CDROMInterface returns a validator that checks if a string is a valid CD-ROM interface.
func CDROMInterface() validator.String {
return stringvalidator.RegexMatches(
regexp.MustCompile(`^ide[0-3]|sata[0-5]|scsi(?:30|[12][0-9]|[0-9])$`),
"one of `ide[0-3]`, `sata[0-5]`, `scsi[0-30]`",
)
}