-
Notifications
You must be signed in to change notification settings - Fork 5
/
provider.go
575 lines (510 loc) · 21.8 KB
/
provider.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
// Copyright © 2023. Citrix Systems, Inc.
package provider
import (
"context"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
"io"
"net"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
"syscall"
"time"
citrixclient "github.com/citrix/citrix-daas-rest-go/client"
"github.com/citrix/terraform-provider-citrix/internal/daas/admin_role"
"github.com/citrix/terraform-provider-citrix/internal/daas/admin_user"
"github.com/citrix/terraform-provider-citrix/internal/daas/application"
"github.com/citrix/terraform-provider-citrix/internal/daas/vda"
"github.com/citrix/terraform-provider-citrix/internal/daas/admin_scope"
"github.com/citrix/terraform-provider-citrix/internal/daas/delivery_group"
"github.com/citrix/terraform-provider-citrix/internal/daas/hypervisor"
"github.com/citrix/terraform-provider-citrix/internal/daas/hypervisor_resource_pool"
"github.com/citrix/terraform-provider-citrix/internal/daas/machine_catalog"
"github.com/citrix/terraform-provider-citrix/internal/daas/policies"
"github.com/citrix/terraform-provider-citrix/internal/daas/zone"
"github.com/citrix/terraform-provider-citrix/internal/util"
"github.com/google/uuid"
"golang.org/x/mod/semver"
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/path"
"github.com/hashicorp/terraform-plugin-framework/provider"
"github.com/hashicorp/terraform-plugin-framework/provider/schema"
"github.com/hashicorp/terraform-plugin-framework/resource"
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-log/tflog"
)
// Ensure the implementation satisfies the expected interfaces
var (
_ provider.Provider = &citrixProvider{}
)
// New is a helper function to simplify provider server and testing implementation.
func New(version string) func() provider.Provider {
return func() provider.Provider {
return &citrixProvider{
version: version,
}
}
}
// citrixProvider is the provider implementation.
type citrixProvider struct {
// version is set to the provider version on release, "dev" when the
// provider is built and ran locally, and "test" when running acceptance
// testing.
version string
}
// citrixProviderModel maps provider schema data to a Go type.
type citrixProviderModel struct {
Hostname types.String `tfsdk:"hostname"`
Environment types.String `tfsdk:"environment"`
CustomerId types.String `tfsdk:"customer_id"`
ClientId types.String `tfsdk:"client_id"`
ClientSecret types.String `tfsdk:"client_secret"`
DisableSslVerification types.Bool `tfsdk:"disable_ssl_verification"`
}
// Metadata returns the provider type name.
func (p *citrixProvider) Metadata(_ context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse) {
resp.TypeName = "citrix"
resp.Version = p.version
}
// Schema defines the provider-level schema for configuration data.
func (p *citrixProvider) Schema(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse) {
resp.Schema = schema.Schema{
Description: "Manage and deploy Citrix resources easily using the Citrix Terraform provider. The provider currently supports both Citrix Virtual Apps & Desktops(CVAD) and Citrix Desktop as a Service (DaaS) solutions. You can automate creation of site setup including host connections, machine catalogs and delivery groups etc for both CVAD and Citrix DaaS. You can deploy resources in Citrix supported hypervisors and public clouds. Currently, we support deployments in Nutanix, VMware vSphere, XenServer, Microsoft Azure, AWS EC2 and Google Cloud Compute. Additionally, you can also use Manual provisioning or RemotePC to add workloads. The provider is developed and maintained by Citrix. Please note that this provider is still in **Tech Preview**.",
Attributes: map[string]schema.Attribute{
"hostname": schema.StringAttribute{
Description: "Host name / base URL of Citrix DaaS service. " + "<br />" +
"For Citrix on-premises customers (Required): Use this to specify Delivery Controller hostname. " + "<br />" +
"For Citrix Cloud customers (Optional): Use this to force override the Citrix DaaS service hostname." + "<br />" +
"Can be set via Environment Variable **CITRIX_HOSTNAME**.",
Optional: true,
},
"environment": schema.StringAttribute{
Description: "Citrix Cloud environment of the customer. Only applicable for Citrix Cloud customers. Available options: `Production`, `Staging`, `Japan`, `JapanStaging`, `Gov`, `GovStaging`. " + "<br />" +
"Can be set via Environment Variable **CITRIX_ENVIRONMENT**.",
Optional: true,
Validators: []validator.String{
stringvalidator.OneOf(
"Production",
"Staging",
"Japan",
"JapanStaging",
"Gov",
"GovStaging",
),
},
},
"customer_id": schema.StringAttribute{
Description: "Citrix Cloud customer ID. Only applicable for Citrix Cloud customers." + "<br />" +
"Can be set via Environment Variable **CITRIX_CUSTOMER_ID**.",
Optional: true,
},
"client_id": schema.StringAttribute{
Description: "Client Id for Citrix DaaS service authentication. " + "<br />" +
"For Citrix On-Premises customers: Use this to specify Domain Admin Username. " + "<br />" +
"For Citrix Cloud customers: Use this to specify Cloud API Key Client Id." + "<br />" +
"Can be set via Environment Variable **CITRIX_CLIENT_ID**.",
Optional: true,
},
"client_secret": schema.StringAttribute{
Description: "Client Secret for Citrix DaaS service authentication. " + "<br />" +
"For Citrix on-premises customers: Use this to specify Domain Admin Password. " + "<br />" +
"For Citrix Cloud customers: Use this to specify Cloud API Key Client Secret." + "<br />" +
"Can be set via Environment Variable **CITRIX_CLIENT_SECRET**.",
Optional: true,
Sensitive: true,
},
"disable_ssl_verification": schema.BoolAttribute{
Description: "Disable SSL verification against the target DDC. " + "<br />" +
"Only applicable to on-premises customers. Citrix Cloud customers should omit this option. Set to true to skip SSL verification only when the target DDC does not have a valid SSL certificate issued by a trusted CA. " + "<br />" +
"When set to true, please make sure that your provider config is set for a known DDC hostname. " + "<br />" +
"[It is recommended to configure a valid certificate for the target DDC](https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/install-configure/install-core/secure-web-studio-deployment) " + "<br />" +
"Can be set via Environment Variable **CITRIX_DISABLE_SSL_VERIFICATION**.",
Optional: true,
},
},
}
}
func middlewareAuthFunc(authClient *citrixclient.CitrixDaasClient, r *http.Request) {
// Auth
if authClient != nil && r.Header.Get("Authorization") == "" {
token, _, err := authClient.SignIn()
if err != nil {
tflog.Error(r.Context(), "Could not sign into Citrix DaaS, error: "+err.Error())
}
r.Header["Authorization"] = []string{token}
}
// TransactionId
transactionId := r.Header.Get("Citrix-TransactionId")
if transactionId == "" {
transactionId = uuid.NewString()
r.Header.Add("Citrix-TransactionId", transactionId)
}
// Log the request
tflog.Info(r.Context(), "Orchestration API request", map[string]interface{}{
"url": r.URL.String(),
"method": r.Method,
"transactionId": transactionId,
})
}
type RegistryResponse struct {
Version string `json:"version"`
}
func getVersionFromTerraformRegistry() (string, error) {
httpResp, err := http.Get("https://registry.terraform.io/v1/providers/citrix/citrix")
if err != nil {
return "", err
}
defer httpResp.Body.Close()
if httpResp.StatusCode != 200 {
return "", err
}
body, err := io.ReadAll(httpResp.Body)
if err != nil {
return "", err
}
registryResp := RegistryResponse{}
err = json.Unmarshal(body, ®istryResp)
if err != nil {
return "", err
}
return registryResp.Version, nil
}
// best effort version check, if anything goes wrong just bail out
func (p *citrixProvider) versionCheck(resp *provider.ConfigureResponse) {
if !semver.IsValid("v" + p.version) {
return
}
var registryVersion string
updateVersionFile := false
versionCheckFilePath := filepath.Join(os.TempDir(), "citrix_provider_version_check.txt")
info, err := os.Stat(versionCheckFilePath)
if err == nil && info != nil && time.Now().Before(info.ModTime().Add(time.Hour*time.Duration(24))) {
// use cached version for version check
txt, err := os.ReadFile(versionCheckFilePath)
if err != nil {
return
}
registryVersion = string(txt)
} else {
registryVersion, err = getVersionFromTerraformRegistry()
if err != nil {
return
}
updateVersionFile = true
}
if semver.Compare("v"+registryVersion, "v"+p.version) > 0 {
resp.Diagnostics.AddWarning(
"New version of the citrix/citrix provider is available",
fmt.Sprintf("Please update the provider version in terraform configuration to >=%s and then run `terraform init --upgrade` to get the latest version.", registryVersion))
}
if updateVersionFile {
err = os.WriteFile(versionCheckFilePath, []byte(registryVersion), 0660)
if err != nil {
return
}
}
}
// Configure prepares a Citrixdaas API client for data sources and resources.
func (p *citrixProvider) Configure(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) {
tflog.Info(ctx, "Configuring Citrix Cloud client")
defer util.PanicHandler(&resp.Diagnostics)
p.versionCheck(resp)
// Retrieve provider data from configuration
var config citrixProviderModel
diags := req.Config.Get(ctx, &config)
resp.Diagnostics.Append(diags...)
if resp.Diagnostics.HasError() {
return
}
// If practitioner provided a configuration value for any of the
// attributes, it must be a known value.
if config.Hostname.IsUnknown() {
resp.Diagnostics.AddAttributeError(
path.Root("hostname"),
"Unknown Citrix DaaS API Hostname",
"The provider cannot create the Citrix API client as there is an unknown configuration value for the Citrix DaaS API hostname. "+
"Either target apply the source of the value first, set the value statically in the configuration, or use the CITRIX_HOSTNAME environment variable.",
)
}
if config.Environment.IsUnknown() {
resp.Diagnostics.AddAttributeError(
path.Root("environment"),
"Unknown Citrix Cloud Environment",
"The provider cannot create the Citrix API client as there is an unknown configuration value for the Citrix Cloud environment. "+
"Either target apply the source of the value first, set the value statically in the configuration, or use the CITRIX_ENVIRONMENT environment variable.",
)
}
if config.CustomerId.IsUnknown() {
resp.Diagnostics.AddAttributeError(
path.Root("customer_id"),
"Unknown Citrix Cloud Customer ID",
"The provider cannot create the Citrix API client as there is an unknown configuration value for the Citrix Cloud Customer ID. "+
"Either target apply the source of the value first, set the value statically in the configuration, or use the CITRIX_CUSTOMER_ID environment variable.",
)
}
if config.ClientId.IsUnknown() {
resp.Diagnostics.AddAttributeError(
path.Root("client_id"),
"Unknown Citrix API Client Id",
"The provider cannot create the Citrix API client as there is an unknown configuration value for the Citrix API ClientId. "+
"Either target apply the source of the value first, set the value statically in the configuration, or use the CITRIX_CLIENT_ID environment variable.",
)
}
if config.ClientSecret.IsUnknown() {
resp.Diagnostics.AddAttributeError(
path.Root("client_secret"),
"Unknown Citrix API Client Secret",
"The provider cannot create the Citrix API client as there is an unknown configuration value for the Citrix API ClientSecret. "+
"Either target apply the source of the value first, set the value statically in the configuration, or use the CITRIX_CLIENT_SECRET environment variable.",
)
}
if resp.Diagnostics.HasError() {
return
}
// Default values to environment variables, but override
// with Terraform configuration value if set.
hostname := os.Getenv("CITRIX_HOSTNAME")
environment := os.Getenv("CITRIX_ENVIRONMENT")
customerId := os.Getenv("CITRIX_CUSTOMER_ID")
clientId := os.Getenv("CITRIX_CLIENT_ID")
clientSecret := os.Getenv("CITRIX_CLIENT_SECRET")
disableSslVerification := strings.EqualFold(os.Getenv("CITRIX_DISABLE_SSL_VERIFICATION"), "true")
if !config.Hostname.IsNull() {
hostname = config.Hostname.ValueString()
}
if !config.Environment.IsNull() {
environment = config.Environment.ValueString()
}
if !config.CustomerId.IsNull() {
customerId = config.CustomerId.ValueString()
}
if !config.ClientId.IsNull() {
clientId = config.ClientId.ValueString()
}
if !config.ClientSecret.IsNull() {
clientSecret = config.ClientSecret.ValueString()
}
if !config.DisableSslVerification.IsNull() {
disableSslVerification = config.DisableSslVerification.ValueBool()
}
if environment == "" {
environment = "Production" // default to production
}
if customerId == "" {
customerId = "CitrixOnPremises"
}
onPremises := false
if customerId == "CitrixOnPremises" {
onPremises = true
}
// If any of the expected configurations are missing, return
// errors with provider-specific guidance.
// On-Premises customer must specify hostname with DDC hostname / IP address
if onPremises && hostname == "" {
resp.Diagnostics.AddAttributeError(
path.Root("hostname"),
"Missing Citrix DaaS API Host",
"The provider cannot create the Citrix API client as there is a missing or empty value for the Citrix DaaS API hostname for on-premises customers. "+
"Set the host value in the configuration. Ensure the value is not empty. ",
)
}
if !onPremises && disableSslVerification {
resp.Diagnostics.AddAttributeError(
path.Root("disable_ssl_verification"),
"Cannot disable SSL verification for Citrix Cloud customer",
"The provider cannot disable SSL verification in the Citrix API client against a Citrix Cloud customer as all Citrix Cloud requests has to go through secured TLS / SSL connection. "+
"Omit disable_ssl_verification or set to false for Citrix Cloud customer. ",
)
}
if clientId == "" {
resp.Diagnostics.AddAttributeError(
path.Root("client_id"),
"Missing Citrix API key ClientId",
"The provider cannot create the Citrix API client as there is a missing or empty value for the Citrix API ClientId. "+
"Set the clientId value in the configuration. Ensure the value is not empty. ",
)
}
if clientSecret == "" {
resp.Diagnostics.AddAttributeError(
path.Root("client_secret"),
"Missing Citrix API key ClientSecret",
"The provider cannot create the Citrix API client as there is a missing or empty value for the Citrix API ClientSecret. "+
"Set the clientSecret value in the configuration. Ensure the value is not empty. ",
)
}
if resp.Diagnostics.HasError() {
return
}
// Indicate whether Citrix Cloud requests should go through API Gateway
apiGateway := true
if !onPremises {
if hostname == "" {
if environment == "Production" {
hostname = "api.cloud.com"
} else if environment == "Staging" {
hostname = "api.cloudburrito.com"
} else if environment == "Japan" {
hostname = "api.citrixcloud.jp"
} else if environment == "JapanStaging" {
hostname = "api.citrixcloudstaging.jp"
} else if environment == "Gov" {
hostname = fmt.Sprintf("%s.xendesktop.us", customerId)
apiGateway = false
} else if environment == "GovStaging" {
hostname = fmt.Sprintf("%s.xdstaging.us", customerId)
apiGateway = false
}
} else if !strings.HasPrefix(hostname, "api.") {
// When a cloud customer sets explicit hostname to the cloud DDC, bypass API Gateway
apiGateway = false
}
}
authUrl := ""
isGov := false
if onPremises {
authUrl = fmt.Sprintf("https://%s/citrix/orchestration/api/techpreview/tokens", hostname)
} else {
if environment == "Production" {
authUrl = fmt.Sprintf("https://api.cloud.com/cctrustoauth2/%s/tokens/clients", customerId)
} else if environment == "Staging" {
authUrl = fmt.Sprintf("https://api.cloudburrito.com/cctrustoauth2/%s/tokens/clients", customerId)
} else if environment == "Japan" {
authUrl = fmt.Sprintf("https://api.citrixcloud.jp/cctrustoauth2/%s/tokens/clients", customerId)
} else if environment == "JapanStaging" {
authUrl = fmt.Sprintf("https://api.citrixcloudstaging.jp/cctrustoauth2/%s/tokens/clients", customerId)
} else if environment == "Gov" {
authUrl = fmt.Sprintf("https://trust.citrixworkspacesapi.us/%s/tokens/clients", customerId)
isGov = true
} else if environment == "GovStaging" {
authUrl = fmt.Sprintf("https://trust.ctxwsstgapi.us/%s/tokens/clients", customerId)
isGov = true
} else {
authUrl = fmt.Sprintf("https://%s/cctrustoauth2/%s/tokens/clients", hostname, customerId)
}
}
ctx = tflog.SetField(ctx, "citrix_hostname", hostname)
if !onPremises {
ctx = tflog.SetField(ctx, "citrix_customer_id", customerId)
}
ctx = tflog.SetField(ctx, "citrix_client_id", clientId)
ctx = tflog.SetField(ctx, "citrix_client_secret", clientSecret)
ctx = tflog.MaskFieldValuesWithFieldKeys(ctx, "citrix_client_secret")
ctx = tflog.SetField(ctx, "citrix_on_premises", onPremises)
tflog.Debug(ctx, "Creating Citrix API client")
userAgent := "citrix-terraform-provider/" + p.version + " (https://github.com/citrix/terraform-provider-citrix)"
// Create a new Citrix API client using the configuration values
client, httpResp, err := citrixclient.NewCitrixDaasClient(ctx, authUrl, hostname, customerId, clientId, clientSecret, onPremises, apiGateway, isGov, disableSslVerification, &userAgent, middlewareAuthFunc)
if err != nil {
if httpResp != nil {
if httpResp.StatusCode == 401 {
resp.Diagnostics.AddError(
"Invalid credential in provider config",
"Make sure client_id and client_secret is correct in provider config. ",
)
} else if httpResp.StatusCode == 503 {
if onPremises {
resp.Diagnostics.AddError(
"Citrix DaaS service unavailable",
"Please check if you can access Web Studio. \n\n"+
"Please ensure that Citrix Orchestration Service on the target DDC(s) are running reachable from this Machine.",
)
} else {
resp.Diagnostics.AddError(
"Citrix DaaS service unavailable",
"The DDC(s) for the customer cannot be reached. Please check if you can access DaaS UI.",
)
}
} else {
resp.Diagnostics.AddError(
"Unable to Create Citrix API Client",
"An unexpected error occurred when creating the Citrix API client. \n\n"+
"Error: "+err.Error(),
)
}
} else {
// Case 1: DDC off
urlErr := new(url.Error)
opErr := new(net.OpError)
syscallErr := new(os.SyscallError)
if errors.As(err, &urlErr) && errors.As(urlErr.Err, &opErr) && errors.As(opErr.Err, &syscallErr) && syscallErr.Err == syscall.Errno(10060) {
resp.Diagnostics.AddError(
"DDC(s) cannot be reached",
"Ensure that the DDC(s) are running. Make sure this machine has proper network routing to reach the DDC(s) and is not blocked by any firewall rules.",
)
return
}
// Case 2: Invalid certificate
cryptoErr := new(tls.CertificateVerificationError)
errors.As(urlErr.Err, &cryptoErr)
if len(cryptoErr.UnverifiedCertificates) > 0 {
resp.Diagnostics.AddError(
"DDC(s) does not have a valid SSL certificate issued by a trusted Certificate Authority",
"If you are running against on-premises DDC(s) that does not have an SSL certificate issue by a trusted CA, consider setting \"disable_ssl_verification\" to \"true\" in provider config.",
)
return
}
// Case 3: Malformed hostname
if urlErr != nil && opErr.Err == nil {
resp.Diagnostics.AddError(
"Invalid DDC(s) hostname",
"Please revise the hostname in provider config and make sure it is a valid hostname or IP address.",
)
return
}
// Case 4: Catch all other errors
resp.Diagnostics.AddError(
"Unable to Create Citrix API Client",
"An unexpected error occurred when creating the Citrix API client. \n\n"+
"Error: "+err.Error(),
)
}
return
}
// Make the Citrix API client available during DataSource and Resource
// type Configure methods.
resp.DataSourceData = client
resp.ResourceData = client
tflog.Info(ctx, "Configured Citrix API client", map[string]any{"success": true})
}
// DataSources defines the data sources implemented in the provider.
func (p *citrixProvider) DataSources(_ context.Context) []func() datasource.DataSource {
return []func() datasource.DataSource{
vda.NewVdaDataSource,
application.NewApplicationDataSourceSource,
admin_scope.NewAdminScopeDataSource,
}
}
// Resources defines the resources implemented in the provider.
func (p *citrixProvider) Resources(_ context.Context) []func() resource.Resource {
return []func() resource.Resource{
zone.NewZoneResource,
hypervisor.NewAzureHypervisorResource,
hypervisor.NewAwsHypervisorResource,
hypervisor.NewGcpHypervisorResource,
hypervisor.NewVsphereHypervisorResource,
hypervisor.NewXenserverHypervisorResource,
hypervisor.NewNutanixHypervisorResource,
hypervisor_resource_pool.NewAzureHypervisorResourcePoolResource,
hypervisor_resource_pool.NewAwsHypervisorResourcePoolResource,
hypervisor_resource_pool.NewGcpHypervisorResourcePoolResource,
hypervisor_resource_pool.NewXenserverHypervisorResourcePoolResource,
hypervisor_resource_pool.NewVsphereHypervisorResourcePoolResource,
hypervisor_resource_pool.NewNutanixHypervisorResourcePoolResource,
machine_catalog.NewMachineCatalogResource,
delivery_group.NewDeliveryGroupResource,
application.NewApplicationResource,
application.NewApplicationFolderResource,
admin_scope.NewAdminScopeResource,
admin_role.NewAdminRoleResource,
policies.NewPolicySetResource,
admin_user.NewAdminUserResource,
//Add resource here
}
}