/
serviceendpointJfrogPlatformV2.go
426 lines (373 loc) · 18.3 KB
/
serviceendpointJfrogPlatformV2.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
// 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 a JFrog Platform V2 server endpoint within an Azure DevOps organization.
//
// > **Note:** Using this service endpoint requires you to first install [JFrog Extension](https://marketplace.visualstudio.com/items?itemName=JFrog.jfrog-azure-devops-extension).
//
// ## Example Usage
//
// <!--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.NewServiceendpointJfrogPlatformV2(ctx, "exampleServiceendpointJfrogPlatformV2", &azuredevops.ServiceendpointJfrogPlatformV2Args{
// ProjectId: exampleProject.ID(),
// ServiceEndpointName: pulumi.String("Example Artifactory"),
// Description: pulumi.String("Managed by Terraform"),
// Url: pulumi.String("https://artifactory.my.com"),
// AuthenticationToken: &azuredevops.ServiceendpointJfrogPlatformV2AuthenticationTokenArgs{
// Token: pulumi.String("0000000000000000000000000000000000000000"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
// Alternatively a username and password may be used.
//
// <!--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.NewServiceendpointJfrogPlatformV2(ctx, "exampleServiceendpointJfrogPlatformV2", &azuredevops.ServiceendpointJfrogPlatformV2Args{
// ProjectId: exampleProject.ID(),
// ServiceEndpointName: pulumi.String("Example Artifactory"),
// Description: pulumi.String("Managed by Terraform"),
// Url: pulumi.String("https://artifactory.my.com"),
// AuthenticationBasic: &azuredevops.ServiceendpointJfrogPlatformV2AuthenticationBasicArgs{
// Username: pulumi.String("username"),
// Password: pulumi.String("password"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Relevant Links
//
// * [Azure DevOps Service Connections](https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml)
// * [Artifactory User Token](https://docs.artifactory.org/latest/user-guide/user-token/)
//
// ## Import
//
// Azure DevOps Service Endpoint JFrog Platform V2 can be imported using the **projectID/serviceEndpointID**, e.g.
//
// ```sh
// $ pulumi import azuredevops:index/serviceendpointJfrogPlatformV2:ServiceendpointJfrogPlatformV2 example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
// ```
type ServiceendpointJfrogPlatformV2 struct {
pulumi.CustomResourceState
// A `authenticationBasic` block as documented below.
AuthenticationBasic ServiceendpointJfrogPlatformV2AuthenticationBasicPtrOutput `pulumi:"authenticationBasic"`
// A `authenticationToken` block as documented below.
AuthenticationToken ServiceendpointJfrogPlatformV2AuthenticationTokenPtrOutput `pulumi:"authenticationToken"`
Authorization pulumi.StringMapOutput `pulumi:"authorization"`
// The Service Endpoint description.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The ID of the project.
ProjectId pulumi.StringOutput `pulumi:"projectId"`
// The Service Endpoint name.
ServiceEndpointName pulumi.StringOutput `pulumi:"serviceEndpointName"`
// URL of the Artifactory server to connect with.
//
// > **NOTE:** URL should not end in a slash character.
Url pulumi.StringOutput `pulumi:"url"`
}
// NewServiceendpointJfrogPlatformV2 registers a new resource with the given unique name, arguments, and options.
func NewServiceendpointJfrogPlatformV2(ctx *pulumi.Context,
name string, args *ServiceendpointJfrogPlatformV2Args, opts ...pulumi.ResourceOption) (*ServiceendpointJfrogPlatformV2, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
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'")
}
if args.Url == nil {
return nil, errors.New("invalid value for required argument 'Url'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ServiceendpointJfrogPlatformV2
err := ctx.RegisterResource("azuredevops:index/serviceendpointJfrogPlatformV2:ServiceendpointJfrogPlatformV2", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetServiceendpointJfrogPlatformV2 gets an existing ServiceendpointJfrogPlatformV2 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 GetServiceendpointJfrogPlatformV2(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ServiceendpointJfrogPlatformV2State, opts ...pulumi.ResourceOption) (*ServiceendpointJfrogPlatformV2, error) {
var resource ServiceendpointJfrogPlatformV2
err := ctx.ReadResource("azuredevops:index/serviceendpointJfrogPlatformV2:ServiceendpointJfrogPlatformV2", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ServiceendpointJfrogPlatformV2 resources.
type serviceendpointJfrogPlatformV2State struct {
// A `authenticationBasic` block as documented below.
AuthenticationBasic *ServiceendpointJfrogPlatformV2AuthenticationBasic `pulumi:"authenticationBasic"`
// A `authenticationToken` block as documented below.
AuthenticationToken *ServiceendpointJfrogPlatformV2AuthenticationToken `pulumi:"authenticationToken"`
Authorization map[string]string `pulumi:"authorization"`
// The Service Endpoint description.
Description *string `pulumi:"description"`
// The ID of the project.
ProjectId *string `pulumi:"projectId"`
// The Service Endpoint name.
ServiceEndpointName *string `pulumi:"serviceEndpointName"`
// URL of the Artifactory server to connect with.
//
// > **NOTE:** URL should not end in a slash character.
Url *string `pulumi:"url"`
}
type ServiceendpointJfrogPlatformV2State struct {
// A `authenticationBasic` block as documented below.
AuthenticationBasic ServiceendpointJfrogPlatformV2AuthenticationBasicPtrInput
// A `authenticationToken` block as documented below.
AuthenticationToken ServiceendpointJfrogPlatformV2AuthenticationTokenPtrInput
Authorization pulumi.StringMapInput
// The Service Endpoint description.
Description pulumi.StringPtrInput
// The ID of the project.
ProjectId pulumi.StringPtrInput
// The Service Endpoint name.
ServiceEndpointName pulumi.StringPtrInput
// URL of the Artifactory server to connect with.
//
// > **NOTE:** URL should not end in a slash character.
Url pulumi.StringPtrInput
}
func (ServiceendpointJfrogPlatformV2State) ElementType() reflect.Type {
return reflect.TypeOf((*serviceendpointJfrogPlatformV2State)(nil)).Elem()
}
type serviceendpointJfrogPlatformV2Args struct {
// A `authenticationBasic` block as documented below.
AuthenticationBasic *ServiceendpointJfrogPlatformV2AuthenticationBasic `pulumi:"authenticationBasic"`
// A `authenticationToken` block as documented below.
AuthenticationToken *ServiceendpointJfrogPlatformV2AuthenticationToken `pulumi:"authenticationToken"`
Authorization map[string]string `pulumi:"authorization"`
// The Service Endpoint description.
Description *string `pulumi:"description"`
// The ID of the project.
ProjectId string `pulumi:"projectId"`
// The Service Endpoint name.
ServiceEndpointName string `pulumi:"serviceEndpointName"`
// URL of the Artifactory server to connect with.
//
// > **NOTE:** URL should not end in a slash character.
Url string `pulumi:"url"`
}
// The set of arguments for constructing a ServiceendpointJfrogPlatformV2 resource.
type ServiceendpointJfrogPlatformV2Args struct {
// A `authenticationBasic` block as documented below.
AuthenticationBasic ServiceendpointJfrogPlatformV2AuthenticationBasicPtrInput
// A `authenticationToken` block as documented below.
AuthenticationToken ServiceendpointJfrogPlatformV2AuthenticationTokenPtrInput
Authorization pulumi.StringMapInput
// The Service Endpoint description.
Description pulumi.StringPtrInput
// The ID of the project.
ProjectId pulumi.StringInput
// The Service Endpoint name.
ServiceEndpointName pulumi.StringInput
// URL of the Artifactory server to connect with.
//
// > **NOTE:** URL should not end in a slash character.
Url pulumi.StringInput
}
func (ServiceendpointJfrogPlatformV2Args) ElementType() reflect.Type {
return reflect.TypeOf((*serviceendpointJfrogPlatformV2Args)(nil)).Elem()
}
type ServiceendpointJfrogPlatformV2Input interface {
pulumi.Input
ToServiceendpointJfrogPlatformV2Output() ServiceendpointJfrogPlatformV2Output
ToServiceendpointJfrogPlatformV2OutputWithContext(ctx context.Context) ServiceendpointJfrogPlatformV2Output
}
func (*ServiceendpointJfrogPlatformV2) ElementType() reflect.Type {
return reflect.TypeOf((**ServiceendpointJfrogPlatformV2)(nil)).Elem()
}
func (i *ServiceendpointJfrogPlatformV2) ToServiceendpointJfrogPlatformV2Output() ServiceendpointJfrogPlatformV2Output {
return i.ToServiceendpointJfrogPlatformV2OutputWithContext(context.Background())
}
func (i *ServiceendpointJfrogPlatformV2) ToServiceendpointJfrogPlatformV2OutputWithContext(ctx context.Context) ServiceendpointJfrogPlatformV2Output {
return pulumi.ToOutputWithContext(ctx, i).(ServiceendpointJfrogPlatformV2Output)
}
// ServiceendpointJfrogPlatformV2ArrayInput is an input type that accepts ServiceendpointJfrogPlatformV2Array and ServiceendpointJfrogPlatformV2ArrayOutput values.
// You can construct a concrete instance of `ServiceendpointJfrogPlatformV2ArrayInput` via:
//
// ServiceendpointJfrogPlatformV2Array{ ServiceendpointJfrogPlatformV2Args{...} }
type ServiceendpointJfrogPlatformV2ArrayInput interface {
pulumi.Input
ToServiceendpointJfrogPlatformV2ArrayOutput() ServiceendpointJfrogPlatformV2ArrayOutput
ToServiceendpointJfrogPlatformV2ArrayOutputWithContext(context.Context) ServiceendpointJfrogPlatformV2ArrayOutput
}
type ServiceendpointJfrogPlatformV2Array []ServiceendpointJfrogPlatformV2Input
func (ServiceendpointJfrogPlatformV2Array) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ServiceendpointJfrogPlatformV2)(nil)).Elem()
}
func (i ServiceendpointJfrogPlatformV2Array) ToServiceendpointJfrogPlatformV2ArrayOutput() ServiceendpointJfrogPlatformV2ArrayOutput {
return i.ToServiceendpointJfrogPlatformV2ArrayOutputWithContext(context.Background())
}
func (i ServiceendpointJfrogPlatformV2Array) ToServiceendpointJfrogPlatformV2ArrayOutputWithContext(ctx context.Context) ServiceendpointJfrogPlatformV2ArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceendpointJfrogPlatformV2ArrayOutput)
}
// ServiceendpointJfrogPlatformV2MapInput is an input type that accepts ServiceendpointJfrogPlatformV2Map and ServiceendpointJfrogPlatformV2MapOutput values.
// You can construct a concrete instance of `ServiceendpointJfrogPlatformV2MapInput` via:
//
// ServiceendpointJfrogPlatformV2Map{ "key": ServiceendpointJfrogPlatformV2Args{...} }
type ServiceendpointJfrogPlatformV2MapInput interface {
pulumi.Input
ToServiceendpointJfrogPlatformV2MapOutput() ServiceendpointJfrogPlatformV2MapOutput
ToServiceendpointJfrogPlatformV2MapOutputWithContext(context.Context) ServiceendpointJfrogPlatformV2MapOutput
}
type ServiceendpointJfrogPlatformV2Map map[string]ServiceendpointJfrogPlatformV2Input
func (ServiceendpointJfrogPlatformV2Map) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ServiceendpointJfrogPlatformV2)(nil)).Elem()
}
func (i ServiceendpointJfrogPlatformV2Map) ToServiceendpointJfrogPlatformV2MapOutput() ServiceendpointJfrogPlatformV2MapOutput {
return i.ToServiceendpointJfrogPlatformV2MapOutputWithContext(context.Background())
}
func (i ServiceendpointJfrogPlatformV2Map) ToServiceendpointJfrogPlatformV2MapOutputWithContext(ctx context.Context) ServiceendpointJfrogPlatformV2MapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceendpointJfrogPlatformV2MapOutput)
}
type ServiceendpointJfrogPlatformV2Output struct{ *pulumi.OutputState }
func (ServiceendpointJfrogPlatformV2Output) ElementType() reflect.Type {
return reflect.TypeOf((**ServiceendpointJfrogPlatformV2)(nil)).Elem()
}
func (o ServiceendpointJfrogPlatformV2Output) ToServiceendpointJfrogPlatformV2Output() ServiceendpointJfrogPlatformV2Output {
return o
}
func (o ServiceendpointJfrogPlatformV2Output) ToServiceendpointJfrogPlatformV2OutputWithContext(ctx context.Context) ServiceendpointJfrogPlatformV2Output {
return o
}
// A `authenticationBasic` block as documented below.
func (o ServiceendpointJfrogPlatformV2Output) AuthenticationBasic() ServiceendpointJfrogPlatformV2AuthenticationBasicPtrOutput {
return o.ApplyT(func(v *ServiceendpointJfrogPlatformV2) ServiceendpointJfrogPlatformV2AuthenticationBasicPtrOutput {
return v.AuthenticationBasic
}).(ServiceendpointJfrogPlatformV2AuthenticationBasicPtrOutput)
}
// A `authenticationToken` block as documented below.
func (o ServiceendpointJfrogPlatformV2Output) AuthenticationToken() ServiceendpointJfrogPlatformV2AuthenticationTokenPtrOutput {
return o.ApplyT(func(v *ServiceendpointJfrogPlatformV2) ServiceendpointJfrogPlatformV2AuthenticationTokenPtrOutput {
return v.AuthenticationToken
}).(ServiceendpointJfrogPlatformV2AuthenticationTokenPtrOutput)
}
func (o ServiceendpointJfrogPlatformV2Output) Authorization() pulumi.StringMapOutput {
return o.ApplyT(func(v *ServiceendpointJfrogPlatformV2) pulumi.StringMapOutput { return v.Authorization }).(pulumi.StringMapOutput)
}
// The Service Endpoint description.
func (o ServiceendpointJfrogPlatformV2Output) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceendpointJfrogPlatformV2) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The ID of the project.
func (o ServiceendpointJfrogPlatformV2Output) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceendpointJfrogPlatformV2) pulumi.StringOutput { return v.ProjectId }).(pulumi.StringOutput)
}
// The Service Endpoint name.
func (o ServiceendpointJfrogPlatformV2Output) ServiceEndpointName() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceendpointJfrogPlatformV2) pulumi.StringOutput { return v.ServiceEndpointName }).(pulumi.StringOutput)
}
// URL of the Artifactory server to connect with.
//
// > **NOTE:** URL should not end in a slash character.
func (o ServiceendpointJfrogPlatformV2Output) Url() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceendpointJfrogPlatformV2) pulumi.StringOutput { return v.Url }).(pulumi.StringOutput)
}
type ServiceendpointJfrogPlatformV2ArrayOutput struct{ *pulumi.OutputState }
func (ServiceendpointJfrogPlatformV2ArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ServiceendpointJfrogPlatformV2)(nil)).Elem()
}
func (o ServiceendpointJfrogPlatformV2ArrayOutput) ToServiceendpointJfrogPlatformV2ArrayOutput() ServiceendpointJfrogPlatformV2ArrayOutput {
return o
}
func (o ServiceendpointJfrogPlatformV2ArrayOutput) ToServiceendpointJfrogPlatformV2ArrayOutputWithContext(ctx context.Context) ServiceendpointJfrogPlatformV2ArrayOutput {
return o
}
func (o ServiceendpointJfrogPlatformV2ArrayOutput) Index(i pulumi.IntInput) ServiceendpointJfrogPlatformV2Output {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ServiceendpointJfrogPlatformV2 {
return vs[0].([]*ServiceendpointJfrogPlatformV2)[vs[1].(int)]
}).(ServiceendpointJfrogPlatformV2Output)
}
type ServiceendpointJfrogPlatformV2MapOutput struct{ *pulumi.OutputState }
func (ServiceendpointJfrogPlatformV2MapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ServiceendpointJfrogPlatformV2)(nil)).Elem()
}
func (o ServiceendpointJfrogPlatformV2MapOutput) ToServiceendpointJfrogPlatformV2MapOutput() ServiceendpointJfrogPlatformV2MapOutput {
return o
}
func (o ServiceendpointJfrogPlatformV2MapOutput) ToServiceendpointJfrogPlatformV2MapOutputWithContext(ctx context.Context) ServiceendpointJfrogPlatformV2MapOutput {
return o
}
func (o ServiceendpointJfrogPlatformV2MapOutput) MapIndex(k pulumi.StringInput) ServiceendpointJfrogPlatformV2Output {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ServiceendpointJfrogPlatformV2 {
return vs[0].(map[string]*ServiceendpointJfrogPlatformV2)[vs[1].(string)]
}).(ServiceendpointJfrogPlatformV2Output)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ServiceendpointJfrogPlatformV2Input)(nil)).Elem(), &ServiceendpointJfrogPlatformV2{})
pulumi.RegisterInputType(reflect.TypeOf((*ServiceendpointJfrogPlatformV2ArrayInput)(nil)).Elem(), ServiceendpointJfrogPlatformV2Array{})
pulumi.RegisterInputType(reflect.TypeOf((*ServiceendpointJfrogPlatformV2MapInput)(nil)).Elem(), ServiceendpointJfrogPlatformV2Map{})
pulumi.RegisterOutputType(ServiceendpointJfrogPlatformV2Output{})
pulumi.RegisterOutputType(ServiceendpointJfrogPlatformV2ArrayOutput{})
pulumi.RegisterOutputType(ServiceendpointJfrogPlatformV2MapOutput{})
}