You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
1.9 KiB
85 lines
1.9 KiB
2 months ago
|
package schemas
|
||
|
|
||
|
import (
|
||
|
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
|
||
|
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
|
||
|
"github.com/hashicorp/terraform-plugin-framework/types"
|
||
|
)
|
||
|
|
||
|
func MakeSchemaResourceK8CI() map[string]schema.Attribute {
|
||
|
return map[string]schema.Attribute{
|
||
|
"name": schema.StringAttribute{
|
||
|
Required: true,
|
||
|
Description: "K8CI name",
|
||
|
},
|
||
|
"version": schema.StringAttribute{
|
||
|
Required: true,
|
||
|
},
|
||
|
"master_driver": schema.StringAttribute{
|
||
|
Required: true,
|
||
|
},
|
||
|
"master_image_id": schema.Int64Attribute{
|
||
|
Required: true,
|
||
|
},
|
||
|
"max_master_count": schema.Int64Attribute{
|
||
|
Required: true,
|
||
|
},
|
||
|
"max_worker_count": schema.Int64Attribute{
|
||
|
Required: true,
|
||
|
},
|
||
|
"worker_image_id": schema.Int64Attribute{
|
||
|
Required: true,
|
||
|
},
|
||
|
"worker_driver": schema.StringAttribute{
|
||
|
Required: true,
|
||
|
},
|
||
|
"network_plugins": schema.ListAttribute{
|
||
|
Required: true,
|
||
|
ElementType: types.StringType,
|
||
|
},
|
||
|
"enabled": schema.BoolAttribute{
|
||
|
Optional: true,
|
||
|
},
|
||
|
"permanently": schema.BoolAttribute{
|
||
|
Optional: true,
|
||
|
Computed: true,
|
||
|
Default: booldefault.StaticBool(true),
|
||
|
// default value is true
|
||
|
},
|
||
|
"restore": schema.BoolAttribute{
|
||
|
Optional: true,
|
||
|
Computed: true,
|
||
|
Default: booldefault.StaticBool(true),
|
||
|
// default value is true
|
||
|
},
|
||
|
"desc": schema.StringAttribute{
|
||
|
Optional: true,
|
||
|
},
|
||
|
"gid": schema.Int64Attribute{
|
||
|
Computed: true,
|
||
|
},
|
||
|
"guid": schema.Int64Attribute{
|
||
|
Computed: true,
|
||
|
},
|
||
|
"k8ci_id": schema.Int64Attribute{
|
||
|
Computed: true,
|
||
|
},
|
||
|
"id": schema.StringAttribute{
|
||
|
Computed: true,
|
||
|
},
|
||
|
"lb_image_id": schema.Int64Attribute{
|
||
|
Computed: true,
|
||
|
},
|
||
|
"milestones": schema.Int64Attribute{
|
||
|
Computed: true,
|
||
|
},
|
||
|
"shared_with": schema.ListAttribute{
|
||
|
Optional: true,
|
||
|
ElementType: types.Int64Type,
|
||
|
},
|
||
|
"status": schema.StringAttribute{
|
||
|
Computed: true,
|
||
|
},
|
||
|
}
|
||
|
}
|