diff --git a/proxmoxtf/resource/validator/vm.go b/proxmoxtf/resource/validator/vm.go index 0c6cce98..e2201e6d 100644 --- a/proxmoxtf/resource/validator/vm.go +++ b/proxmoxtf/resource/validator/vm.go @@ -253,6 +253,18 @@ func IDEInterface() schema.SchemaValidateDiagFunc { }, false)) } +// CloudInitInterface is a schema validation function that accepts either an IDE interface identifier or an +// empty string, which is used as the default and means "detect which interface should be used automatically". +func CloudInitInterface() schema.SchemaValidateDiagFunc { + return validation.ToDiagFunc(validation.StringInSlice([]string{ + "", + "ide0", + "ide1", + "ide2", + "ide3", + }, false)) +} + // CloudInitType is a schema validation function for cloud-init types. func CloudInitType() schema.SchemaValidateDiagFunc { return validation.ToDiagFunc(validation.StringInSlice([]string{ diff --git a/proxmoxtf/resource/vm.go b/proxmoxtf/resource/vm.go index 8eae9808..451ab98e 100644 --- a/proxmoxtf/resource/vm.go +++ b/proxmoxtf/resource/vm.go @@ -795,7 +795,7 @@ func VM() *schema.Resource { Description: "The IDE interface on which the CloudInit drive will be added", Optional: true, Default: dvResourceVirtualEnvironmentVMInitializationInterface, - ValidateDiagFunc: validator.IDEInterface(), + ValidateDiagFunc: validator.CloudInitInterface(), DiffSuppressFunc: func(k, oldValue, newValue string, d *schema.ResourceData) bool { return newValue == "" },