generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 40
/
resource_group_data_source.go
124 lines (119 loc) · 3.48 KB
/
resource_group_data_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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package resource_group
import (
"github.com/harness/terraform-provider-harness/helpers"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func DataSourceResourceGroup() *schema.Resource {
resource := &schema.Resource{
Description: "DataSource for looking up resource group in harness.",
ReadContext: resourceResourceGroupRead,
Schema: map[string]*schema.Schema{
"color": {
Description: "Color of the environment.",
Type: schema.TypeString,
Computed: true,
},
"account_id": {
Description: "Account Identifier of the account",
Type: schema.TypeString,
Computed: true,
},
"allowed_scope_levels": {
Description: "The scope levels at which this resource group can be used",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"included_scopes": {
Description: "Included scopes",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"account_id": {
Description: "Account Identifier of the account",
Type: schema.TypeString,
Computed: true,
},
"org_id": {
Description: "Organization Identifier",
Type: schema.TypeString,
Computed: true,
},
"project_id": {
Description: "Project Identifier",
Type: schema.TypeString,
Computed: true,
},
"filter": {
Description: "Can be one of these 2 EXCLUDING_CHILD_SCOPES or INCLUDING_CHILD_SCOPES",
Type: schema.TypeString,
Computed: true,
},
}},
},
"resource_filter": {
Description: "Contains resource filter for a resource group",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"include_all_resources": {
Description: "Include all resource or not",
Type: schema.TypeBool,
Computed: true,
},
"resources": {
Description: "Resources for a resource group",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"resource_type": {
Description: "Type of the resource",
Type: schema.TypeString,
Computed: true,
},
"identifiers": {
Description: "List of the identifiers",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"attribute_filter": {
Description: "Used to filter resources on their attributes",
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"attribute_name": {
Description: "Name of the attribute",
Type: schema.TypeString,
Computed: true,
},
"attribute_values": {
Description: "Value of the attributes",
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
},
},
},
},
},
},
},
},
},
},
}
helpers.SetMultiLevelDatasourceSchemaIdentifierRequired(resource.Schema)
return resource
}