/
serviceEndpointAzureRM.go
708 lines (645 loc) · 34.2 KB
/
serviceEndpointAzureRM.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
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package azuredevops
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages Manual or Automatic AzureRM service endpoint within Azure DevOps.
//
// ## Requirements (Manual AzureRM Service Endpoint)
//
// Before to create a service end point in Azure DevOps, you need to create a Service Principal in your Azure subscription.
//
// For detailed steps to create a service principal with Azure cli see the [documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli?view=azure-cli-latest)
//
// ## Example Usage
//
// ### Service Principal Manual AzureRM Service Endpoint (Subscription Scoped)
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleProject, err := azuredevops.NewProject(ctx, "exampleProject", &azuredevops.ProjectArgs{
// Visibility: pulumi.String("private"),
// VersionControl: pulumi.String("Git"),
// WorkItemTemplate: pulumi.String("Agile"),
// Description: pulumi.String("Managed by Terraform"),
// })
// if err != nil {
// return err
// }
// _, err = azuredevops.NewServiceEndpointAzureRM(ctx, "exampleServiceEndpointAzureRM", &azuredevops.ServiceEndpointAzureRMArgs{
// ProjectId: exampleProject.ID(),
// ServiceEndpointName: pulumi.String("Example AzureRM"),
// Description: pulumi.String("Managed by Terraform"),
// ServiceEndpointAuthenticationScheme: pulumi.String("ServicePrincipal"),
// Credentials: &azuredevops.ServiceEndpointAzureRMCredentialsArgs{
// Serviceprincipalid: pulumi.String("00000000-0000-0000-0000-000000000000"),
// Serviceprincipalkey: pulumi.String("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
// },
// AzurermSpnTenantid: pulumi.String("00000000-0000-0000-0000-000000000000"),
// AzurermSubscriptionId: pulumi.String("00000000-0000-0000-0000-000000000000"),
// AzurermSubscriptionName: pulumi.String("Example Subscription Name"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Service Principal Manual AzureRM Service Endpoint (ManagementGroup Scoped)
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleProject, err := azuredevops.NewProject(ctx, "exampleProject", &azuredevops.ProjectArgs{
// Visibility: pulumi.String("private"),
// VersionControl: pulumi.String("Git"),
// WorkItemTemplate: pulumi.String("Agile"),
// Description: pulumi.String("Managed by Terraform"),
// })
// if err != nil {
// return err
// }
// _, err = azuredevops.NewServiceEndpointAzureRM(ctx, "exampleServiceEndpointAzureRM", &azuredevops.ServiceEndpointAzureRMArgs{
// ProjectId: exampleProject.ID(),
// ServiceEndpointName: pulumi.String("Example AzureRM"),
// Description: pulumi.String("Managed by Terraform"),
// ServiceEndpointAuthenticationScheme: pulumi.String("ServicePrincipal"),
// Credentials: &azuredevops.ServiceEndpointAzureRMCredentialsArgs{
// Serviceprincipalid: pulumi.String("00000000-0000-0000-0000-000000000000"),
// Serviceprincipalkey: pulumi.String("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
// },
// AzurermSpnTenantid: pulumi.String("00000000-0000-0000-0000-000000000000"),
// AzurermManagementGroupId: pulumi.String("managementGroup"),
// AzurermManagementGroupName: pulumi.String("managementGroup"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Service Principal Automatic AzureRM Service Endpoint
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleProject, err := azuredevops.NewProject(ctx, "exampleProject", &azuredevops.ProjectArgs{
// Visibility: pulumi.String("private"),
// VersionControl: pulumi.String("Git"),
// WorkItemTemplate: pulumi.String("Agile"),
// })
// if err != nil {
// return err
// }
// _, err = azuredevops.NewServiceEndpointAzureRM(ctx, "exampleServiceEndpointAzureRM", &azuredevops.ServiceEndpointAzureRMArgs{
// ProjectId: exampleProject.ID(),
// ServiceEndpointName: pulumi.String("Example AzureRM"),
// ServiceEndpointAuthenticationScheme: pulumi.String("ServicePrincipal"),
// AzurermSpnTenantid: pulumi.String("00000000-0000-0000-0000-000000000000"),
// AzurermSubscriptionId: pulumi.String("00000000-0000-0000-0000-000000000000"),
// AzurermSubscriptionName: pulumi.String("Example Subscription Name"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Workload Identity Federation Automatic AzureRM Service Endpoint
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleProject, err := azuredevops.NewProject(ctx, "exampleProject", &azuredevops.ProjectArgs{
// Visibility: pulumi.String("private"),
// VersionControl: pulumi.String("Git"),
// WorkItemTemplate: pulumi.String("Agile"),
// })
// if err != nil {
// return err
// }
// _, err = azuredevops.NewServiceEndpointAzureRM(ctx, "exampleServiceEndpointAzureRM", &azuredevops.ServiceEndpointAzureRMArgs{
// ProjectId: exampleProject.ID(),
// ServiceEndpointName: pulumi.String("Example AzureRM"),
// ServiceEndpointAuthenticationScheme: pulumi.String("WorkloadIdentityFederation"),
// AzurermSpnTenantid: pulumi.String("00000000-0000-0000-0000-000000000000"),
// AzurermSubscriptionId: pulumi.String("00000000-0000-0000-0000-000000000000"),
// AzurermSubscriptionName: pulumi.String("Example Subscription Name"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Managed Identity AzureRM Service Endpoint
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// exampleProject, err := azuredevops.NewProject(ctx, "exampleProject", &azuredevops.ProjectArgs{
// Visibility: pulumi.String("private"),
// VersionControl: pulumi.String("Git"),
// WorkItemTemplate: pulumi.String("Agile"),
// })
// if err != nil {
// return err
// }
// _, err = azuredevops.NewServiceEndpointAzureRM(ctx, "exampleServiceEndpointAzureRM", &azuredevops.ServiceEndpointAzureRMArgs{
// ProjectId: exampleProject.ID(),
// ServiceEndpointName: pulumi.String("Example AzureRM"),
// ServiceEndpointAuthenticationScheme: pulumi.String("ManagedServiceIdentity"),
// AzurermSpnTenantid: pulumi.String("00000000-0000-0000-0000-000000000000"),
// AzurermSubscriptionId: pulumi.String("00000000-0000-0000-0000-000000000000"),
// AzurermSubscriptionName: pulumi.String("Example Subscription Name"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Relevant Links
//
// - [Azure DevOps Service REST API 7.0 - Service End points](https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints?view=azure-devops-rest-7.0)
//
// ## Import
//
// Azure DevOps Service Endpoint Azure Resource Manage can be imported using **projectID/serviceEndpointID** or **projectName/serviceEndpointID**
//
// ```sh
// $ pulumi import azuredevops:index/serviceEndpointAzureRM:ServiceEndpointAzureRM example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
// ```
type ServiceEndpointAzureRM struct {
pulumi.CustomResourceState
Authorization pulumi.StringMapOutput `pulumi:"authorization"`
// The Management group ID of the Azure targets.
AzurermManagementGroupId pulumi.StringPtrOutput `pulumi:"azurermManagementGroupId"`
// The Management group Name of the targets.
AzurermManagementGroupName pulumi.StringPtrOutput `pulumi:"azurermManagementGroupName"`
// The Tenant ID if the service principal.
AzurermSpnTenantid pulumi.StringOutput `pulumi:"azurermSpnTenantid"`
// The Subscription ID of the Azure targets.
AzurermSubscriptionId pulumi.StringPtrOutput `pulumi:"azurermSubscriptionId"`
// The Subscription Name of the targets.
AzurermSubscriptionName pulumi.StringPtrOutput `pulumi:"azurermSubscriptionName"`
// A `credentials` block.
Credentials ServiceEndpointAzureRMCredentialsPtrOutput `pulumi:"credentials"`
// Service connection description.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The Cloud Environment to use. Defaults to `AzureCloud`. Possible values are `AzureCloud`, `AzureChinaCloud`. Changing this forces a new resource to be created.
//
// > **NOTE:** One of either `Subscription` scoped i.e. `azurermSubscriptionId`, `azurermSubscriptionName` or `ManagementGroup` scoped i.e. `azurermManagementGroupId`, `azurermManagementGroupName` values must be specified.
Environment pulumi.StringPtrOutput `pulumi:"environment"`
// A `features` block.
Features ServiceEndpointAzureRMFeaturesPtrOutput `pulumi:"features"`
// The ID of the project.
ProjectId pulumi.StringOutput `pulumi:"projectId"`
// The resource group used for scope of automatic service endpoint.
ResourceGroup pulumi.StringPtrOutput `pulumi:"resourceGroup"`
// Specifies the type of azurerm endpoint, either `WorkloadIdentityFederation`, `ManagedServiceIdentity` or `ServicePrincipal`. Defaults to `ServicePrincipal` for backwards compatibility.
//
// > **NOTE:** The `WorkloadIdentityFederation` authentication scheme is currently in private preview. Your organisation must be part of the preview and the feature toggle must be turned on to use it. More details can be found [here](https://aka.ms/azdo-rm-workload-identity).
ServiceEndpointAuthenticationScheme pulumi.StringPtrOutput `pulumi:"serviceEndpointAuthenticationScheme"`
// The Service Endpoint Name.
ServiceEndpointName pulumi.StringOutput `pulumi:"serviceEndpointName"`
// The Application(Client) ID of the Service Principal.
ServicePrincipalId pulumi.StringOutput `pulumi:"servicePrincipalId"`
// The issuer if `serviceEndpointAuthenticationScheme` is set to `WorkloadIdentityFederation`. This looks like `https://vstoken.dev.azure.com/00000000-0000-0000-0000-000000000000`, where the GUID is the Organization ID of your Azure DevOps Organisation.
WorkloadIdentityFederationIssuer pulumi.StringOutput `pulumi:"workloadIdentityFederationIssuer"`
// The subject if `serviceEndpointAuthenticationScheme` is set to `WorkloadIdentityFederation`. This looks like `sc://<organisation>/<project>/<service-connection-name>`.
WorkloadIdentityFederationSubject pulumi.StringOutput `pulumi:"workloadIdentityFederationSubject"`
}
// NewServiceEndpointAzureRM registers a new resource with the given unique name, arguments, and options.
func NewServiceEndpointAzureRM(ctx *pulumi.Context,
name string, args *ServiceEndpointAzureRMArgs, opts ...pulumi.ResourceOption) (*ServiceEndpointAzureRM, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AzurermSpnTenantid == nil {
return nil, errors.New("invalid value for required argument 'AzurermSpnTenantid'")
}
if args.ProjectId == nil {
return nil, errors.New("invalid value for required argument 'ProjectId'")
}
if args.ServiceEndpointName == nil {
return nil, errors.New("invalid value for required argument 'ServiceEndpointName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ServiceEndpointAzureRM
err := ctx.RegisterResource("azuredevops:index/serviceEndpointAzureRM:ServiceEndpointAzureRM", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetServiceEndpointAzureRM gets an existing ServiceEndpointAzureRM resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetServiceEndpointAzureRM(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ServiceEndpointAzureRMState, opts ...pulumi.ResourceOption) (*ServiceEndpointAzureRM, error) {
var resource ServiceEndpointAzureRM
err := ctx.ReadResource("azuredevops:index/serviceEndpointAzureRM:ServiceEndpointAzureRM", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ServiceEndpointAzureRM resources.
type serviceEndpointAzureRMState struct {
Authorization map[string]string `pulumi:"authorization"`
// The Management group ID of the Azure targets.
AzurermManagementGroupId *string `pulumi:"azurermManagementGroupId"`
// The Management group Name of the targets.
AzurermManagementGroupName *string `pulumi:"azurermManagementGroupName"`
// The Tenant ID if the service principal.
AzurermSpnTenantid *string `pulumi:"azurermSpnTenantid"`
// The Subscription ID of the Azure targets.
AzurermSubscriptionId *string `pulumi:"azurermSubscriptionId"`
// The Subscription Name of the targets.
AzurermSubscriptionName *string `pulumi:"azurermSubscriptionName"`
// A `credentials` block.
Credentials *ServiceEndpointAzureRMCredentials `pulumi:"credentials"`
// Service connection description.
Description *string `pulumi:"description"`
// The Cloud Environment to use. Defaults to `AzureCloud`. Possible values are `AzureCloud`, `AzureChinaCloud`. Changing this forces a new resource to be created.
//
// > **NOTE:** One of either `Subscription` scoped i.e. `azurermSubscriptionId`, `azurermSubscriptionName` or `ManagementGroup` scoped i.e. `azurermManagementGroupId`, `azurermManagementGroupName` values must be specified.
Environment *string `pulumi:"environment"`
// A `features` block.
Features *ServiceEndpointAzureRMFeatures `pulumi:"features"`
// The ID of the project.
ProjectId *string `pulumi:"projectId"`
// The resource group used for scope of automatic service endpoint.
ResourceGroup *string `pulumi:"resourceGroup"`
// Specifies the type of azurerm endpoint, either `WorkloadIdentityFederation`, `ManagedServiceIdentity` or `ServicePrincipal`. Defaults to `ServicePrincipal` for backwards compatibility.
//
// > **NOTE:** The `WorkloadIdentityFederation` authentication scheme is currently in private preview. Your organisation must be part of the preview and the feature toggle must be turned on to use it. More details can be found [here](https://aka.ms/azdo-rm-workload-identity).
ServiceEndpointAuthenticationScheme *string `pulumi:"serviceEndpointAuthenticationScheme"`
// The Service Endpoint Name.
ServiceEndpointName *string `pulumi:"serviceEndpointName"`
// The Application(Client) ID of the Service Principal.
ServicePrincipalId *string `pulumi:"servicePrincipalId"`
// The issuer if `serviceEndpointAuthenticationScheme` is set to `WorkloadIdentityFederation`. This looks like `https://vstoken.dev.azure.com/00000000-0000-0000-0000-000000000000`, where the GUID is the Organization ID of your Azure DevOps Organisation.
WorkloadIdentityFederationIssuer *string `pulumi:"workloadIdentityFederationIssuer"`
// The subject if `serviceEndpointAuthenticationScheme` is set to `WorkloadIdentityFederation`. This looks like `sc://<organisation>/<project>/<service-connection-name>`.
WorkloadIdentityFederationSubject *string `pulumi:"workloadIdentityFederationSubject"`
}
type ServiceEndpointAzureRMState struct {
Authorization pulumi.StringMapInput
// The Management group ID of the Azure targets.
AzurermManagementGroupId pulumi.StringPtrInput
// The Management group Name of the targets.
AzurermManagementGroupName pulumi.StringPtrInput
// The Tenant ID if the service principal.
AzurermSpnTenantid pulumi.StringPtrInput
// The Subscription ID of the Azure targets.
AzurermSubscriptionId pulumi.StringPtrInput
// The Subscription Name of the targets.
AzurermSubscriptionName pulumi.StringPtrInput
// A `credentials` block.
Credentials ServiceEndpointAzureRMCredentialsPtrInput
// Service connection description.
Description pulumi.StringPtrInput
// The Cloud Environment to use. Defaults to `AzureCloud`. Possible values are `AzureCloud`, `AzureChinaCloud`. Changing this forces a new resource to be created.
//
// > **NOTE:** One of either `Subscription` scoped i.e. `azurermSubscriptionId`, `azurermSubscriptionName` or `ManagementGroup` scoped i.e. `azurermManagementGroupId`, `azurermManagementGroupName` values must be specified.
Environment pulumi.StringPtrInput
// A `features` block.
Features ServiceEndpointAzureRMFeaturesPtrInput
// The ID of the project.
ProjectId pulumi.StringPtrInput
// The resource group used for scope of automatic service endpoint.
ResourceGroup pulumi.StringPtrInput
// Specifies the type of azurerm endpoint, either `WorkloadIdentityFederation`, `ManagedServiceIdentity` or `ServicePrincipal`. Defaults to `ServicePrincipal` for backwards compatibility.
//
// > **NOTE:** The `WorkloadIdentityFederation` authentication scheme is currently in private preview. Your organisation must be part of the preview and the feature toggle must be turned on to use it. More details can be found [here](https://aka.ms/azdo-rm-workload-identity).
ServiceEndpointAuthenticationScheme pulumi.StringPtrInput
// The Service Endpoint Name.
ServiceEndpointName pulumi.StringPtrInput
// The Application(Client) ID of the Service Principal.
ServicePrincipalId pulumi.StringPtrInput
// The issuer if `serviceEndpointAuthenticationScheme` is set to `WorkloadIdentityFederation`. This looks like `https://vstoken.dev.azure.com/00000000-0000-0000-0000-000000000000`, where the GUID is the Organization ID of your Azure DevOps Organisation.
WorkloadIdentityFederationIssuer pulumi.StringPtrInput
// The subject if `serviceEndpointAuthenticationScheme` is set to `WorkloadIdentityFederation`. This looks like `sc://<organisation>/<project>/<service-connection-name>`.
WorkloadIdentityFederationSubject pulumi.StringPtrInput
}
func (ServiceEndpointAzureRMState) ElementType() reflect.Type {
return reflect.TypeOf((*serviceEndpointAzureRMState)(nil)).Elem()
}
type serviceEndpointAzureRMArgs struct {
Authorization map[string]string `pulumi:"authorization"`
// The Management group ID of the Azure targets.
AzurermManagementGroupId *string `pulumi:"azurermManagementGroupId"`
// The Management group Name of the targets.
AzurermManagementGroupName *string `pulumi:"azurermManagementGroupName"`
// The Tenant ID if the service principal.
AzurermSpnTenantid string `pulumi:"azurermSpnTenantid"`
// The Subscription ID of the Azure targets.
AzurermSubscriptionId *string `pulumi:"azurermSubscriptionId"`
// The Subscription Name of the targets.
AzurermSubscriptionName *string `pulumi:"azurermSubscriptionName"`
// A `credentials` block.
Credentials *ServiceEndpointAzureRMCredentials `pulumi:"credentials"`
// Service connection description.
Description *string `pulumi:"description"`
// The Cloud Environment to use. Defaults to `AzureCloud`. Possible values are `AzureCloud`, `AzureChinaCloud`. Changing this forces a new resource to be created.
//
// > **NOTE:** One of either `Subscription` scoped i.e. `azurermSubscriptionId`, `azurermSubscriptionName` or `ManagementGroup` scoped i.e. `azurermManagementGroupId`, `azurermManagementGroupName` values must be specified.
Environment *string `pulumi:"environment"`
// A `features` block.
Features *ServiceEndpointAzureRMFeatures `pulumi:"features"`
// The ID of the project.
ProjectId string `pulumi:"projectId"`
// The resource group used for scope of automatic service endpoint.
ResourceGroup *string `pulumi:"resourceGroup"`
// Specifies the type of azurerm endpoint, either `WorkloadIdentityFederation`, `ManagedServiceIdentity` or `ServicePrincipal`. Defaults to `ServicePrincipal` for backwards compatibility.
//
// > **NOTE:** The `WorkloadIdentityFederation` authentication scheme is currently in private preview. Your organisation must be part of the preview and the feature toggle must be turned on to use it. More details can be found [here](https://aka.ms/azdo-rm-workload-identity).
ServiceEndpointAuthenticationScheme *string `pulumi:"serviceEndpointAuthenticationScheme"`
// The Service Endpoint Name.
ServiceEndpointName string `pulumi:"serviceEndpointName"`
}
// The set of arguments for constructing a ServiceEndpointAzureRM resource.
type ServiceEndpointAzureRMArgs struct {
Authorization pulumi.StringMapInput
// The Management group ID of the Azure targets.
AzurermManagementGroupId pulumi.StringPtrInput
// The Management group Name of the targets.
AzurermManagementGroupName pulumi.StringPtrInput
// The Tenant ID if the service principal.
AzurermSpnTenantid pulumi.StringInput
// The Subscription ID of the Azure targets.
AzurermSubscriptionId pulumi.StringPtrInput
// The Subscription Name of the targets.
AzurermSubscriptionName pulumi.StringPtrInput
// A `credentials` block.
Credentials ServiceEndpointAzureRMCredentialsPtrInput
// Service connection description.
Description pulumi.StringPtrInput
// The Cloud Environment to use. Defaults to `AzureCloud`. Possible values are `AzureCloud`, `AzureChinaCloud`. Changing this forces a new resource to be created.
//
// > **NOTE:** One of either `Subscription` scoped i.e. `azurermSubscriptionId`, `azurermSubscriptionName` or `ManagementGroup` scoped i.e. `azurermManagementGroupId`, `azurermManagementGroupName` values must be specified.
Environment pulumi.StringPtrInput
// A `features` block.
Features ServiceEndpointAzureRMFeaturesPtrInput
// The ID of the project.
ProjectId pulumi.StringInput
// The resource group used for scope of automatic service endpoint.
ResourceGroup pulumi.StringPtrInput
// Specifies the type of azurerm endpoint, either `WorkloadIdentityFederation`, `ManagedServiceIdentity` or `ServicePrincipal`. Defaults to `ServicePrincipal` for backwards compatibility.
//
// > **NOTE:** The `WorkloadIdentityFederation` authentication scheme is currently in private preview. Your organisation must be part of the preview and the feature toggle must be turned on to use it. More details can be found [here](https://aka.ms/azdo-rm-workload-identity).
ServiceEndpointAuthenticationScheme pulumi.StringPtrInput
// The Service Endpoint Name.
ServiceEndpointName pulumi.StringInput
}
func (ServiceEndpointAzureRMArgs) ElementType() reflect.Type {
return reflect.TypeOf((*serviceEndpointAzureRMArgs)(nil)).Elem()
}
type ServiceEndpointAzureRMInput interface {
pulumi.Input
ToServiceEndpointAzureRMOutput() ServiceEndpointAzureRMOutput
ToServiceEndpointAzureRMOutputWithContext(ctx context.Context) ServiceEndpointAzureRMOutput
}
func (*ServiceEndpointAzureRM) ElementType() reflect.Type {
return reflect.TypeOf((**ServiceEndpointAzureRM)(nil)).Elem()
}
func (i *ServiceEndpointAzureRM) ToServiceEndpointAzureRMOutput() ServiceEndpointAzureRMOutput {
return i.ToServiceEndpointAzureRMOutputWithContext(context.Background())
}
func (i *ServiceEndpointAzureRM) ToServiceEndpointAzureRMOutputWithContext(ctx context.Context) ServiceEndpointAzureRMOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceEndpointAzureRMOutput)
}
// ServiceEndpointAzureRMArrayInput is an input type that accepts ServiceEndpointAzureRMArray and ServiceEndpointAzureRMArrayOutput values.
// You can construct a concrete instance of `ServiceEndpointAzureRMArrayInput` via:
//
// ServiceEndpointAzureRMArray{ ServiceEndpointAzureRMArgs{...} }
type ServiceEndpointAzureRMArrayInput interface {
pulumi.Input
ToServiceEndpointAzureRMArrayOutput() ServiceEndpointAzureRMArrayOutput
ToServiceEndpointAzureRMArrayOutputWithContext(context.Context) ServiceEndpointAzureRMArrayOutput
}
type ServiceEndpointAzureRMArray []ServiceEndpointAzureRMInput
func (ServiceEndpointAzureRMArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ServiceEndpointAzureRM)(nil)).Elem()
}
func (i ServiceEndpointAzureRMArray) ToServiceEndpointAzureRMArrayOutput() ServiceEndpointAzureRMArrayOutput {
return i.ToServiceEndpointAzureRMArrayOutputWithContext(context.Background())
}
func (i ServiceEndpointAzureRMArray) ToServiceEndpointAzureRMArrayOutputWithContext(ctx context.Context) ServiceEndpointAzureRMArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceEndpointAzureRMArrayOutput)
}
// ServiceEndpointAzureRMMapInput is an input type that accepts ServiceEndpointAzureRMMap and ServiceEndpointAzureRMMapOutput values.
// You can construct a concrete instance of `ServiceEndpointAzureRMMapInput` via:
//
// ServiceEndpointAzureRMMap{ "key": ServiceEndpointAzureRMArgs{...} }
type ServiceEndpointAzureRMMapInput interface {
pulumi.Input
ToServiceEndpointAzureRMMapOutput() ServiceEndpointAzureRMMapOutput
ToServiceEndpointAzureRMMapOutputWithContext(context.Context) ServiceEndpointAzureRMMapOutput
}
type ServiceEndpointAzureRMMap map[string]ServiceEndpointAzureRMInput
func (ServiceEndpointAzureRMMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ServiceEndpointAzureRM)(nil)).Elem()
}
func (i ServiceEndpointAzureRMMap) ToServiceEndpointAzureRMMapOutput() ServiceEndpointAzureRMMapOutput {
return i.ToServiceEndpointAzureRMMapOutputWithContext(context.Background())
}
func (i ServiceEndpointAzureRMMap) ToServiceEndpointAzureRMMapOutputWithContext(ctx context.Context) ServiceEndpointAzureRMMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceEndpointAzureRMMapOutput)
}
type ServiceEndpointAzureRMOutput struct{ *pulumi.OutputState }
func (ServiceEndpointAzureRMOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ServiceEndpointAzureRM)(nil)).Elem()
}
func (o ServiceEndpointAzureRMOutput) ToServiceEndpointAzureRMOutput() ServiceEndpointAzureRMOutput {
return o
}
func (o ServiceEndpointAzureRMOutput) ToServiceEndpointAzureRMOutputWithContext(ctx context.Context) ServiceEndpointAzureRMOutput {
return o
}
func (o ServiceEndpointAzureRMOutput) Authorization() pulumi.StringMapOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringMapOutput { return v.Authorization }).(pulumi.StringMapOutput)
}
// The Management group ID of the Azure targets.
func (o ServiceEndpointAzureRMOutput) AzurermManagementGroupId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringPtrOutput { return v.AzurermManagementGroupId }).(pulumi.StringPtrOutput)
}
// The Management group Name of the targets.
func (o ServiceEndpointAzureRMOutput) AzurermManagementGroupName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringPtrOutput { return v.AzurermManagementGroupName }).(pulumi.StringPtrOutput)
}
// The Tenant ID if the service principal.
func (o ServiceEndpointAzureRMOutput) AzurermSpnTenantid() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringOutput { return v.AzurermSpnTenantid }).(pulumi.StringOutput)
}
// The Subscription ID of the Azure targets.
func (o ServiceEndpointAzureRMOutput) AzurermSubscriptionId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringPtrOutput { return v.AzurermSubscriptionId }).(pulumi.StringPtrOutput)
}
// The Subscription Name of the targets.
func (o ServiceEndpointAzureRMOutput) AzurermSubscriptionName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringPtrOutput { return v.AzurermSubscriptionName }).(pulumi.StringPtrOutput)
}
// A `credentials` block.
func (o ServiceEndpointAzureRMOutput) Credentials() ServiceEndpointAzureRMCredentialsPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) ServiceEndpointAzureRMCredentialsPtrOutput { return v.Credentials }).(ServiceEndpointAzureRMCredentialsPtrOutput)
}
// Service connection description.
func (o ServiceEndpointAzureRMOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The Cloud Environment to use. Defaults to `AzureCloud`. Possible values are `AzureCloud`, `AzureChinaCloud`. Changing this forces a new resource to be created.
//
// > **NOTE:** One of either `Subscription` scoped i.e. `azurermSubscriptionId`, `azurermSubscriptionName` or `ManagementGroup` scoped i.e. `azurermManagementGroupId`, `azurermManagementGroupName` values must be specified.
func (o ServiceEndpointAzureRMOutput) Environment() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringPtrOutput { return v.Environment }).(pulumi.StringPtrOutput)
}
// A `features` block.
func (o ServiceEndpointAzureRMOutput) Features() ServiceEndpointAzureRMFeaturesPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) ServiceEndpointAzureRMFeaturesPtrOutput { return v.Features }).(ServiceEndpointAzureRMFeaturesPtrOutput)
}
// The ID of the project.
func (o ServiceEndpointAzureRMOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringOutput { return v.ProjectId }).(pulumi.StringOutput)
}
// The resource group used for scope of automatic service endpoint.
func (o ServiceEndpointAzureRMOutput) ResourceGroup() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringPtrOutput { return v.ResourceGroup }).(pulumi.StringPtrOutput)
}
// Specifies the type of azurerm endpoint, either `WorkloadIdentityFederation`, `ManagedServiceIdentity` or `ServicePrincipal`. Defaults to `ServicePrincipal` for backwards compatibility.
//
// > **NOTE:** The `WorkloadIdentityFederation` authentication scheme is currently in private preview. Your organisation must be part of the preview and the feature toggle must be turned on to use it. More details can be found [here](https://aka.ms/azdo-rm-workload-identity).
func (o ServiceEndpointAzureRMOutput) ServiceEndpointAuthenticationScheme() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringPtrOutput { return v.ServiceEndpointAuthenticationScheme }).(pulumi.StringPtrOutput)
}
// The Service Endpoint Name.
func (o ServiceEndpointAzureRMOutput) ServiceEndpointName() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringOutput { return v.ServiceEndpointName }).(pulumi.StringOutput)
}
// The Application(Client) ID of the Service Principal.
func (o ServiceEndpointAzureRMOutput) ServicePrincipalId() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringOutput { return v.ServicePrincipalId }).(pulumi.StringOutput)
}
// The issuer if `serviceEndpointAuthenticationScheme` is set to `WorkloadIdentityFederation`. This looks like `https://vstoken.dev.azure.com/00000000-0000-0000-0000-000000000000`, where the GUID is the Organization ID of your Azure DevOps Organisation.
func (o ServiceEndpointAzureRMOutput) WorkloadIdentityFederationIssuer() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringOutput { return v.WorkloadIdentityFederationIssuer }).(pulumi.StringOutput)
}
// The subject if `serviceEndpointAuthenticationScheme` is set to `WorkloadIdentityFederation`. This looks like `sc://<organisation>/<project>/<service-connection-name>`.
func (o ServiceEndpointAzureRMOutput) WorkloadIdentityFederationSubject() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceEndpointAzureRM) pulumi.StringOutput { return v.WorkloadIdentityFederationSubject }).(pulumi.StringOutput)
}
type ServiceEndpointAzureRMArrayOutput struct{ *pulumi.OutputState }
func (ServiceEndpointAzureRMArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ServiceEndpointAzureRM)(nil)).Elem()
}
func (o ServiceEndpointAzureRMArrayOutput) ToServiceEndpointAzureRMArrayOutput() ServiceEndpointAzureRMArrayOutput {
return o
}
func (o ServiceEndpointAzureRMArrayOutput) ToServiceEndpointAzureRMArrayOutputWithContext(ctx context.Context) ServiceEndpointAzureRMArrayOutput {
return o
}
func (o ServiceEndpointAzureRMArrayOutput) Index(i pulumi.IntInput) ServiceEndpointAzureRMOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ServiceEndpointAzureRM {
return vs[0].([]*ServiceEndpointAzureRM)[vs[1].(int)]
}).(ServiceEndpointAzureRMOutput)
}
type ServiceEndpointAzureRMMapOutput struct{ *pulumi.OutputState }
func (ServiceEndpointAzureRMMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ServiceEndpointAzureRM)(nil)).Elem()
}
func (o ServiceEndpointAzureRMMapOutput) ToServiceEndpointAzureRMMapOutput() ServiceEndpointAzureRMMapOutput {
return o
}
func (o ServiceEndpointAzureRMMapOutput) ToServiceEndpointAzureRMMapOutputWithContext(ctx context.Context) ServiceEndpointAzureRMMapOutput {
return o
}
func (o ServiceEndpointAzureRMMapOutput) MapIndex(k pulumi.StringInput) ServiceEndpointAzureRMOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ServiceEndpointAzureRM {
return vs[0].(map[string]*ServiceEndpointAzureRM)[vs[1].(string)]
}).(ServiceEndpointAzureRMOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ServiceEndpointAzureRMInput)(nil)).Elem(), &ServiceEndpointAzureRM{})
pulumi.RegisterInputType(reflect.TypeOf((*ServiceEndpointAzureRMArrayInput)(nil)).Elem(), ServiceEndpointAzureRMArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ServiceEndpointAzureRMMapInput)(nil)).Elem(), ServiceEndpointAzureRMMap{})
pulumi.RegisterOutputType(ServiceEndpointAzureRMOutput{})
pulumi.RegisterOutputType(ServiceEndpointAzureRMArrayOutput{})
pulumi.RegisterOutputType(ServiceEndpointAzureRMMapOutput{})
}