-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathschema_source.go
101 lines (97 loc) · 2.08 KB
/
schema_source.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package main
import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
func sourceFields() map[string]*schema.Schema {
s := map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
Description: "Source name",
},
"description": {
Type: schema.TypeString,
Required: true,
Description: "Source description",
},
"type": {
Type: schema.TypeString,
Optional: true,
Description: "Specifies the type of system being managed",
},
"connector": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: "Source connector type",
},
"delete_threshold": {
Type: schema.TypeInt,
Optional: true,
Default: 10,
},
"authoritative": {
Type: schema.TypeBool,
Optional: true,
Description: "True if this source is authoritative",
Default: false,
},
"owner": {
Type: schema.TypeList,
MaxItems: 1,
Required: true,
Elem: &schema.Resource{
Schema: sourceOwnerFields(),
},
},
"schemas": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: sourceSchemaFields(),
},
},
"cluster": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Elem: &schema.Resource{
Schema: sourceClusterFields(),
},
},
"account_correlation_config": {
Type: schema.TypeList,
MaxItems: 1,
Computed: true,
Elem: &schema.Resource{
Schema: sourceAccountCorrelationConfigFields(),
},
},
"connector_attributes": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Elem: &schema.Resource{
Schema: sourceConnectorAttributesFields(),
},
},
"management_workgroup": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: sourceManagementWorkgroupFields(),
},
},
"password_policies": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: sourcePasswordPoliciesFields(),
},
},
}
//for k, v := range commonAnnotationLabelFields() {
// s[k] = v
//}
return s
}