/
acl_schema.go
44 lines (39 loc) · 1.45 KB
/
acl_schema.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package vdc
import (
schemaR "github.com/hashicorp/terraform-plugin-framework/resource/schema"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
superschema "github.com/FrangipaneTeam/terraform-plugin-framework-superschema"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/acl"
"github.com/orange-cloudavenue/terraform-provider-cloudavenue/internal/provider/common/vdc"
)
/*
aclSchema
This function is used to create the superschema for the vDC ACL.
*/
func aclSchema() superschema.Schema {
return superschema.Schema{
Common: superschema.SchemaDetails{
MarkdownDescription: "Provides a Cloud Avenue vDC access control resource.",
},
Resource: superschema.SchemaDetails{
MarkdownDescription: "This can be used to share vDC across users and/or groups.",
},
Attributes: map[string]superschema.Attribute{
"id": superschema.StringAttribute{
Common: &schemaR.StringAttribute{
MarkdownDescription: "The ID of the acl rule.",
},
Resource: &schemaR.StringAttribute{
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
},
"vdc": vdc.SuperSchema(),
"everyone_access_level": acl.SuperSchema(true)["everyone_access_level"],
"shared_with": acl.SuperSchema(true)["shared_with"],
},
}
}