0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 18:42:58 +00:00
terraform-provider-proxmox/fwprovider/vm/cloudinit/model.go
Pavel Boldyrev d91a559fb5
clone works
Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
2024-09-22 21:34:23 -04:00

40 lines
1.0 KiB
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 cloudinit
import (
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/types"
)
// Model represents the Cloud-Init model.
type Model struct {
DatastoreID types.String `tfsdk:"datastore_id"`
Interface types.String `tfsdk:"interface"`
DNS DNSValue `tfsdk:"dns"`
}
type ModelDNS struct {
Domain types.String `tfsdk:"domain"`
Servers types.List `tfsdk:"servers"`
}
func attributeTypes() map[string]attr.Type {
return map[string]attr.Type{
"datastore_id": types.StringType,
"interface": types.StringType,
"dns": types.ObjectType{}.WithAttributeTypes(attributeTypesDNS()),
}
}
func attributeTypesDNS() map[string]attr.Type {
return map[string]attr.Type{
"domain": types.StringType,
"servers": types.ListType{ElemType: types.StringType},
}
}