/
serviceEndpointAws.go
416 lines (360 loc) · 17.1 KB
/
serviceEndpointAws.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
// 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/v2/go/azuredevops/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a AWS service endpoint within Azure DevOps. Using this service endpoint requires you to first install [AWS Toolkit for Azure DevOps](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.aws-vsts-tools).
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azuredevops/sdk/v2/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.NewServiceEndpointAws(ctx, "exampleServiceEndpointAws", &azuredevops.ServiceEndpointAwsArgs{
// ProjectId: exampleProject.ID(),
// ServiceEndpointName: pulumi.String("Example AWS"),
// AccessKeyId: pulumi.String("00000000-0000-0000-0000-000000000000"),
// SecretAccessKey: pulumi.String("accesskey"),
// Description: pulumi.String("Managed by AzureDevOps"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Relevant Links
//
// * [aws-toolkit-azure-devops](https://github.com/aws/aws-toolkit-azure-devops)
// * [Azure DevOps Service REST API 7.0 - Agent Pools](https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints?view=azure-devops-rest-7.0)
//
// ## Import
//
// Azure DevOps Service Endpoint AWS can be imported using **projectID/serviceEndpointID** or **projectName/serviceEndpointID**
//
// ```sh
// $ pulumi import azuredevops:index/serviceEndpointAws:ServiceEndpointAws azuredevops_serviceendpoint_aws.example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
// ```
type ServiceEndpointAws struct {
pulumi.CustomResourceState
// The AWS access key ID for signing programmatic requests.
AccessKeyId pulumi.StringOutput `pulumi:"accessKeyId"`
Authorization pulumi.StringMapOutput `pulumi:"authorization"`
Description pulumi.StringPtrOutput `pulumi:"description"`
// A unique identifier that is used by third parties when assuming roles in their customers' accounts, aka cross-account role access.
ExternalId pulumi.StringPtrOutput `pulumi:"externalId"`
// The ID of the project.
ProjectId pulumi.StringOutput `pulumi:"projectId"`
// Optional identifier for the assumed role session.
RoleSessionName pulumi.StringPtrOutput `pulumi:"roleSessionName"`
// The Amazon Resource Name (ARN) of the role to assume.
RoleToAssume pulumi.StringPtrOutput `pulumi:"roleToAssume"`
// The AWS secret access key for signing programmatic requests.
SecretAccessKey pulumi.StringOutput `pulumi:"secretAccessKey"`
// The Service Endpoint name.
ServiceEndpointName pulumi.StringOutput `pulumi:"serviceEndpointName"`
// The AWS session token for signing programmatic requests.
SessionToken pulumi.StringPtrOutput `pulumi:"sessionToken"`
}
// NewServiceEndpointAws registers a new resource with the given unique name, arguments, and options.
func NewServiceEndpointAws(ctx *pulumi.Context,
name string, args *ServiceEndpointAwsArgs, opts ...pulumi.ResourceOption) (*ServiceEndpointAws, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccessKeyId == nil {
return nil, errors.New("invalid value for required argument 'AccessKeyId'")
}
if args.ProjectId == nil {
return nil, errors.New("invalid value for required argument 'ProjectId'")
}
if args.SecretAccessKey == nil {
return nil, errors.New("invalid value for required argument 'SecretAccessKey'")
}
if args.ServiceEndpointName == nil {
return nil, errors.New("invalid value for required argument 'ServiceEndpointName'")
}
if args.SecretAccessKey != nil {
args.SecretAccessKey = pulumi.ToSecret(args.SecretAccessKey).(pulumi.StringInput)
}
if args.SessionToken != nil {
args.SessionToken = pulumi.ToSecret(args.SessionToken).(pulumi.StringPtrInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"secretAccessKey",
"sessionToken",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource ServiceEndpointAws
err := ctx.RegisterResource("azuredevops:index/serviceEndpointAws:ServiceEndpointAws", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetServiceEndpointAws gets an existing ServiceEndpointAws 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 GetServiceEndpointAws(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ServiceEndpointAwsState, opts ...pulumi.ResourceOption) (*ServiceEndpointAws, error) {
var resource ServiceEndpointAws
err := ctx.ReadResource("azuredevops:index/serviceEndpointAws:ServiceEndpointAws", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ServiceEndpointAws resources.
type serviceEndpointAwsState struct {
// The AWS access key ID for signing programmatic requests.
AccessKeyId *string `pulumi:"accessKeyId"`
Authorization map[string]string `pulumi:"authorization"`
Description *string `pulumi:"description"`
// A unique identifier that is used by third parties when assuming roles in their customers' accounts, aka cross-account role access.
ExternalId *string `pulumi:"externalId"`
// The ID of the project.
ProjectId *string `pulumi:"projectId"`
// Optional identifier for the assumed role session.
RoleSessionName *string `pulumi:"roleSessionName"`
// The Amazon Resource Name (ARN) of the role to assume.
RoleToAssume *string `pulumi:"roleToAssume"`
// The AWS secret access key for signing programmatic requests.
SecretAccessKey *string `pulumi:"secretAccessKey"`
// The Service Endpoint name.
ServiceEndpointName *string `pulumi:"serviceEndpointName"`
// The AWS session token for signing programmatic requests.
SessionToken *string `pulumi:"sessionToken"`
}
type ServiceEndpointAwsState struct {
// The AWS access key ID for signing programmatic requests.
AccessKeyId pulumi.StringPtrInput
Authorization pulumi.StringMapInput
Description pulumi.StringPtrInput
// A unique identifier that is used by third parties when assuming roles in their customers' accounts, aka cross-account role access.
ExternalId pulumi.StringPtrInput
// The ID of the project.
ProjectId pulumi.StringPtrInput
// Optional identifier for the assumed role session.
RoleSessionName pulumi.StringPtrInput
// The Amazon Resource Name (ARN) of the role to assume.
RoleToAssume pulumi.StringPtrInput
// The AWS secret access key for signing programmatic requests.
SecretAccessKey pulumi.StringPtrInput
// The Service Endpoint name.
ServiceEndpointName pulumi.StringPtrInput
// The AWS session token for signing programmatic requests.
SessionToken pulumi.StringPtrInput
}
func (ServiceEndpointAwsState) ElementType() reflect.Type {
return reflect.TypeOf((*serviceEndpointAwsState)(nil)).Elem()
}
type serviceEndpointAwsArgs struct {
// The AWS access key ID for signing programmatic requests.
AccessKeyId string `pulumi:"accessKeyId"`
Authorization map[string]string `pulumi:"authorization"`
Description *string `pulumi:"description"`
// A unique identifier that is used by third parties when assuming roles in their customers' accounts, aka cross-account role access.
ExternalId *string `pulumi:"externalId"`
// The ID of the project.
ProjectId string `pulumi:"projectId"`
// Optional identifier for the assumed role session.
RoleSessionName *string `pulumi:"roleSessionName"`
// The Amazon Resource Name (ARN) of the role to assume.
RoleToAssume *string `pulumi:"roleToAssume"`
// The AWS secret access key for signing programmatic requests.
SecretAccessKey string `pulumi:"secretAccessKey"`
// The Service Endpoint name.
ServiceEndpointName string `pulumi:"serviceEndpointName"`
// The AWS session token for signing programmatic requests.
SessionToken *string `pulumi:"sessionToken"`
}
// The set of arguments for constructing a ServiceEndpointAws resource.
type ServiceEndpointAwsArgs struct {
// The AWS access key ID for signing programmatic requests.
AccessKeyId pulumi.StringInput
Authorization pulumi.StringMapInput
Description pulumi.StringPtrInput
// A unique identifier that is used by third parties when assuming roles in their customers' accounts, aka cross-account role access.
ExternalId pulumi.StringPtrInput
// The ID of the project.
ProjectId pulumi.StringInput
// Optional identifier for the assumed role session.
RoleSessionName pulumi.StringPtrInput
// The Amazon Resource Name (ARN) of the role to assume.
RoleToAssume pulumi.StringPtrInput
// The AWS secret access key for signing programmatic requests.
SecretAccessKey pulumi.StringInput
// The Service Endpoint name.
ServiceEndpointName pulumi.StringInput
// The AWS session token for signing programmatic requests.
SessionToken pulumi.StringPtrInput
}
func (ServiceEndpointAwsArgs) ElementType() reflect.Type {
return reflect.TypeOf((*serviceEndpointAwsArgs)(nil)).Elem()
}
type ServiceEndpointAwsInput interface {
pulumi.Input
ToServiceEndpointAwsOutput() ServiceEndpointAwsOutput
ToServiceEndpointAwsOutputWithContext(ctx context.Context) ServiceEndpointAwsOutput
}
func (*ServiceEndpointAws) ElementType() reflect.Type {
return reflect.TypeOf((**ServiceEndpointAws)(nil)).Elem()
}
func (i *ServiceEndpointAws) ToServiceEndpointAwsOutput() ServiceEndpointAwsOutput {
return i.ToServiceEndpointAwsOutputWithContext(context.Background())
}
func (i *ServiceEndpointAws) ToServiceEndpointAwsOutputWithContext(ctx context.Context) ServiceEndpointAwsOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceEndpointAwsOutput)
}
// ServiceEndpointAwsArrayInput is an input type that accepts ServiceEndpointAwsArray and ServiceEndpointAwsArrayOutput values.
// You can construct a concrete instance of `ServiceEndpointAwsArrayInput` via:
//
// ServiceEndpointAwsArray{ ServiceEndpointAwsArgs{...} }
type ServiceEndpointAwsArrayInput interface {
pulumi.Input
ToServiceEndpointAwsArrayOutput() ServiceEndpointAwsArrayOutput
ToServiceEndpointAwsArrayOutputWithContext(context.Context) ServiceEndpointAwsArrayOutput
}
type ServiceEndpointAwsArray []ServiceEndpointAwsInput
func (ServiceEndpointAwsArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ServiceEndpointAws)(nil)).Elem()
}
func (i ServiceEndpointAwsArray) ToServiceEndpointAwsArrayOutput() ServiceEndpointAwsArrayOutput {
return i.ToServiceEndpointAwsArrayOutputWithContext(context.Background())
}
func (i ServiceEndpointAwsArray) ToServiceEndpointAwsArrayOutputWithContext(ctx context.Context) ServiceEndpointAwsArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceEndpointAwsArrayOutput)
}
// ServiceEndpointAwsMapInput is an input type that accepts ServiceEndpointAwsMap and ServiceEndpointAwsMapOutput values.
// You can construct a concrete instance of `ServiceEndpointAwsMapInput` via:
//
// ServiceEndpointAwsMap{ "key": ServiceEndpointAwsArgs{...} }
type ServiceEndpointAwsMapInput interface {
pulumi.Input
ToServiceEndpointAwsMapOutput() ServiceEndpointAwsMapOutput
ToServiceEndpointAwsMapOutputWithContext(context.Context) ServiceEndpointAwsMapOutput
}
type ServiceEndpointAwsMap map[string]ServiceEndpointAwsInput
func (ServiceEndpointAwsMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ServiceEndpointAws)(nil)).Elem()
}
func (i ServiceEndpointAwsMap) ToServiceEndpointAwsMapOutput() ServiceEndpointAwsMapOutput {
return i.ToServiceEndpointAwsMapOutputWithContext(context.Background())
}
func (i ServiceEndpointAwsMap) ToServiceEndpointAwsMapOutputWithContext(ctx context.Context) ServiceEndpointAwsMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceEndpointAwsMapOutput)
}
type ServiceEndpointAwsOutput struct{ *pulumi.OutputState }
func (ServiceEndpointAwsOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ServiceEndpointAws)(nil)).Elem()
}
func (o ServiceEndpointAwsOutput) ToServiceEndpointAwsOutput() ServiceEndpointAwsOutput {
return o
}
func (o ServiceEndpointAwsOutput) ToServiceEndpointAwsOutputWithContext(ctx context.Context) ServiceEndpointAwsOutput {
return o
}
// The AWS access key ID for signing programmatic requests.
func (o ServiceEndpointAwsOutput) AccessKeyId() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceEndpointAws) pulumi.StringOutput { return v.AccessKeyId }).(pulumi.StringOutput)
}
func (o ServiceEndpointAwsOutput) Authorization() pulumi.StringMapOutput {
return o.ApplyT(func(v *ServiceEndpointAws) pulumi.StringMapOutput { return v.Authorization }).(pulumi.StringMapOutput)
}
func (o ServiceEndpointAwsOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAws) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// A unique identifier that is used by third parties when assuming roles in their customers' accounts, aka cross-account role access.
func (o ServiceEndpointAwsOutput) ExternalId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAws) pulumi.StringPtrOutput { return v.ExternalId }).(pulumi.StringPtrOutput)
}
// The ID of the project.
func (o ServiceEndpointAwsOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceEndpointAws) pulumi.StringOutput { return v.ProjectId }).(pulumi.StringOutput)
}
// Optional identifier for the assumed role session.
func (o ServiceEndpointAwsOutput) RoleSessionName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAws) pulumi.StringPtrOutput { return v.RoleSessionName }).(pulumi.StringPtrOutput)
}
// The Amazon Resource Name (ARN) of the role to assume.
func (o ServiceEndpointAwsOutput) RoleToAssume() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAws) pulumi.StringPtrOutput { return v.RoleToAssume }).(pulumi.StringPtrOutput)
}
// The AWS secret access key for signing programmatic requests.
func (o ServiceEndpointAwsOutput) SecretAccessKey() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceEndpointAws) pulumi.StringOutput { return v.SecretAccessKey }).(pulumi.StringOutput)
}
// The Service Endpoint name.
func (o ServiceEndpointAwsOutput) ServiceEndpointName() pulumi.StringOutput {
return o.ApplyT(func(v *ServiceEndpointAws) pulumi.StringOutput { return v.ServiceEndpointName }).(pulumi.StringOutput)
}
// The AWS session token for signing programmatic requests.
func (o ServiceEndpointAwsOutput) SessionToken() pulumi.StringPtrOutput {
return o.ApplyT(func(v *ServiceEndpointAws) pulumi.StringPtrOutput { return v.SessionToken }).(pulumi.StringPtrOutput)
}
type ServiceEndpointAwsArrayOutput struct{ *pulumi.OutputState }
func (ServiceEndpointAwsArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ServiceEndpointAws)(nil)).Elem()
}
func (o ServiceEndpointAwsArrayOutput) ToServiceEndpointAwsArrayOutput() ServiceEndpointAwsArrayOutput {
return o
}
func (o ServiceEndpointAwsArrayOutput) ToServiceEndpointAwsArrayOutputWithContext(ctx context.Context) ServiceEndpointAwsArrayOutput {
return o
}
func (o ServiceEndpointAwsArrayOutput) Index(i pulumi.IntInput) ServiceEndpointAwsOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ServiceEndpointAws {
return vs[0].([]*ServiceEndpointAws)[vs[1].(int)]
}).(ServiceEndpointAwsOutput)
}
type ServiceEndpointAwsMapOutput struct{ *pulumi.OutputState }
func (ServiceEndpointAwsMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ServiceEndpointAws)(nil)).Elem()
}
func (o ServiceEndpointAwsMapOutput) ToServiceEndpointAwsMapOutput() ServiceEndpointAwsMapOutput {
return o
}
func (o ServiceEndpointAwsMapOutput) ToServiceEndpointAwsMapOutputWithContext(ctx context.Context) ServiceEndpointAwsMapOutput {
return o
}
func (o ServiceEndpointAwsMapOutput) MapIndex(k pulumi.StringInput) ServiceEndpointAwsOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ServiceEndpointAws {
return vs[0].(map[string]*ServiceEndpointAws)[vs[1].(string)]
}).(ServiceEndpointAwsOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ServiceEndpointAwsInput)(nil)).Elem(), &ServiceEndpointAws{})
pulumi.RegisterInputType(reflect.TypeOf((*ServiceEndpointAwsArrayInput)(nil)).Elem(), ServiceEndpointAwsArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ServiceEndpointAwsMapInput)(nil)).Elem(), ServiceEndpointAwsMap{})
pulumi.RegisterOutputType(ServiceEndpointAwsOutput{})
pulumi.RegisterOutputType(ServiceEndpointAwsArrayOutput{})
pulumi.RegisterOutputType(ServiceEndpointAwsMapOutput{})
}