/
bucket.go
563 lines (503 loc) · 24.5 KB
/
bucket.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package storage
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Creates a new bucket in Google cloud storage service (GCS).
// Once a bucket has been created, its location can't be changed.
// [ACLs](https://cloud.google.com/storage/docs/access-control/lists) can be applied
// using the [`storage.BucketACL`](https://www.terraform.io/docs/providers/google/r/storage_bucket_acl.html) resource.
//
// For more information see
// [the official documentation](https://cloud.google.com/storage/docs/overview)
// and
// [API](https://cloud.google.com/storage/docs/json_api/v1/buckets).
//
// **Note**: If the project id is not set on the resource or in the provider block it will be dynamically
// determined which will require enabling the compute api.
//
// ## Example Usage
// ### Creating A Private Bucket In Standard Storage, In The EU Region. Bucket Configured As Static Website And CORS Configurations
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-gcp/sdk/v4/go/gcp/storage"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := storage.NewBucket(ctx, "static_site", &storage.BucketArgs{
// Cors: storage.BucketCorArray{
// &storage.BucketCorArgs{
// MaxAgeSeconds: pulumi.Int(3600),
// Methods: pulumi.StringArray{
// pulumi.String("GET"),
// pulumi.String("HEAD"),
// pulumi.String("PUT"),
// pulumi.String("POST"),
// pulumi.String("DELETE"),
// },
// Origins: pulumi.StringArray{
// pulumi.String("http://image-store.com"),
// },
// ResponseHeaders: pulumi.StringArray{
// pulumi.String("*"),
// },
// },
// },
// ForceDestroy: pulumi.Bool(true),
// Location: pulumi.String("EU"),
// UniformBucketLevelAccess: pulumi.Bool(true),
// Website: &storage.BucketWebsiteArgs{
// MainPageSuffix: pulumi.String("index.html"),
// NotFoundPage: pulumi.String("404.html"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ### Life Cycle Settings For Storage Bucket Objects
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-gcp/sdk/v4/go/gcp/storage"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := storage.NewBucket(ctx, "auto_expire", &storage.BucketArgs{
// ForceDestroy: pulumi.Bool(true),
// LifecycleRules: storage.BucketLifecycleRuleArray{
// &storage.BucketLifecycleRuleArgs{
// Action: &storage.BucketLifecycleRuleActionArgs{
// Type: pulumi.String("Delete"),
// },
// Condition: &storage.BucketLifecycleRuleConditionArgs{
// Age: pulumi.Int(3),
// },
// },
// },
// Location: pulumi.String("US"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Storage buckets can be imported using the `name` or
//
// `project/name`. If the project is not passed to the import command it will be inferred from the provider block or environment variables. If it cannot be inferred it will be queried from the Compute API (this will fail if the API is not enabled). e.g.
//
// ```sh
// $ pulumi import gcp:storage/bucket:Bucket image-store image-store-bucket
// ```
//
// ```sh
// $ pulumi import gcp:storage/bucket:Bucket image-store tf-test-project/image-store-bucket
// ```
//
// `false` in state. If you've set it to `true` in config, run `terraform apply` to update the value set in state. If you delete this resource before updating the value, objects in the bucket will not be destroyed.
type Bucket struct {
pulumi.CustomResourceState
// Enables [Bucket Policy Only](https://cloud.google.com/storage/docs/bucket-policy-only) access to a bucket. This field will be removed in the next major release of the provider.
//
// Deprecated: Please use the uniform_bucket_level_access as this field has been renamed by Google.
BucketPolicyOnly pulumi.BoolOutput `pulumi:"bucketPolicyOnly"`
// The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
Cors BucketCorArrayOutput `pulumi:"cors"`
DefaultEventBasedHold pulumi.BoolPtrOutput `pulumi:"defaultEventBasedHold"`
// The bucket's encryption configuration.
Encryption BucketEncryptionPtrOutput `pulumi:"encryption"`
// When deleting a bucket, this
// boolean option will delete all contained objects. If you try to delete a
// bucket that contains objects, the provider will fail that run.
ForceDestroy pulumi.BoolPtrOutput `pulumi:"forceDestroy"`
// A map of key/value label pairs to assign to the bucket.
Labels pulumi.StringMapOutput `pulumi:"labels"`
// The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
LifecycleRules BucketLifecycleRuleArrayOutput `pulumi:"lifecycleRules"`
// The [GCS location](https://cloud.google.com/storage/docs/bucket-locations)
Location pulumi.StringPtrOutput `pulumi:"location"`
// The bucket's [Access & Storage Logs](https://cloud.google.com/storage/docs/access-logs) configuration.
Logging BucketLoggingPtrOutput `pulumi:"logging"`
// The name of the bucket.
Name pulumi.StringOutput `pulumi:"name"`
// The ID of the project in which the resource belongs. If it
// is not provided, the provider project is used.
Project pulumi.StringOutput `pulumi:"project"`
// Enables [Requester Pays](https://cloud.google.com/storage/docs/requester-pays) on a storage bucket.
RequesterPays pulumi.BoolPtrOutput `pulumi:"requesterPays"`
// Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
RetentionPolicy BucketRetentionPolicyPtrOutput `pulumi:"retentionPolicy"`
// The URI of the created resource.
SelfLink pulumi.StringOutput `pulumi:"selfLink"`
// The target [Storage Class](https://cloud.google.com/storage/docs/storage-classes) of objects affected by this Lifecycle Rule. Supported values include: `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`, `ARCHIVE`.
StorageClass pulumi.StringPtrOutput `pulumi:"storageClass"`
// Enables [Uniform bucket-level access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) access to a bucket.
UniformBucketLevelAccess pulumi.BoolOutput `pulumi:"uniformBucketLevelAccess"`
// The base URL of the bucket, in the format `gs://<bucket-name>`.
Url pulumi.StringOutput `pulumi:"url"`
// The bucket's [Versioning](https://cloud.google.com/storage/docs/object-versioning) configuration.
Versioning BucketVersioningPtrOutput `pulumi:"versioning"`
// Configuration if the bucket acts as a website. Structure is documented below.
Website BucketWebsitePtrOutput `pulumi:"website"`
}
// NewBucket registers a new resource with the given unique name, arguments, and options.
func NewBucket(ctx *pulumi.Context,
name string, args *BucketArgs, opts ...pulumi.ResourceOption) (*Bucket, error) {
if args == nil {
args = &BucketArgs{}
}
var resource Bucket
err := ctx.RegisterResource("gcp:storage/bucket:Bucket", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBucket gets an existing Bucket 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 GetBucket(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BucketState, opts ...pulumi.ResourceOption) (*Bucket, error) {
var resource Bucket
err := ctx.ReadResource("gcp:storage/bucket:Bucket", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Bucket resources.
type bucketState struct {
// Enables [Bucket Policy Only](https://cloud.google.com/storage/docs/bucket-policy-only) access to a bucket. This field will be removed in the next major release of the provider.
//
// Deprecated: Please use the uniform_bucket_level_access as this field has been renamed by Google.
BucketPolicyOnly *bool `pulumi:"bucketPolicyOnly"`
// The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
Cors []BucketCor `pulumi:"cors"`
DefaultEventBasedHold *bool `pulumi:"defaultEventBasedHold"`
// The bucket's encryption configuration.
Encryption *BucketEncryption `pulumi:"encryption"`
// When deleting a bucket, this
// boolean option will delete all contained objects. If you try to delete a
// bucket that contains objects, the provider will fail that run.
ForceDestroy *bool `pulumi:"forceDestroy"`
// A map of key/value label pairs to assign to the bucket.
Labels map[string]string `pulumi:"labels"`
// The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
LifecycleRules []BucketLifecycleRule `pulumi:"lifecycleRules"`
// The [GCS location](https://cloud.google.com/storage/docs/bucket-locations)
Location *string `pulumi:"location"`
// The bucket's [Access & Storage Logs](https://cloud.google.com/storage/docs/access-logs) configuration.
Logging *BucketLogging `pulumi:"logging"`
// The name of the bucket.
Name *string `pulumi:"name"`
// The ID of the project in which the resource belongs. If it
// is not provided, the provider project is used.
Project *string `pulumi:"project"`
// Enables [Requester Pays](https://cloud.google.com/storage/docs/requester-pays) on a storage bucket.
RequesterPays *bool `pulumi:"requesterPays"`
// Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
RetentionPolicy *BucketRetentionPolicy `pulumi:"retentionPolicy"`
// The URI of the created resource.
SelfLink *string `pulumi:"selfLink"`
// The target [Storage Class](https://cloud.google.com/storage/docs/storage-classes) of objects affected by this Lifecycle Rule. Supported values include: `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`, `ARCHIVE`.
StorageClass *string `pulumi:"storageClass"`
// Enables [Uniform bucket-level access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) access to a bucket.
UniformBucketLevelAccess *bool `pulumi:"uniformBucketLevelAccess"`
// The base URL of the bucket, in the format `gs://<bucket-name>`.
Url *string `pulumi:"url"`
// The bucket's [Versioning](https://cloud.google.com/storage/docs/object-versioning) configuration.
Versioning *BucketVersioning `pulumi:"versioning"`
// Configuration if the bucket acts as a website. Structure is documented below.
Website *BucketWebsite `pulumi:"website"`
}
type BucketState struct {
// Enables [Bucket Policy Only](https://cloud.google.com/storage/docs/bucket-policy-only) access to a bucket. This field will be removed in the next major release of the provider.
//
// Deprecated: Please use the uniform_bucket_level_access as this field has been renamed by Google.
BucketPolicyOnly pulumi.BoolPtrInput
// The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
Cors BucketCorArrayInput
DefaultEventBasedHold pulumi.BoolPtrInput
// The bucket's encryption configuration.
Encryption BucketEncryptionPtrInput
// When deleting a bucket, this
// boolean option will delete all contained objects. If you try to delete a
// bucket that contains objects, the provider will fail that run.
ForceDestroy pulumi.BoolPtrInput
// A map of key/value label pairs to assign to the bucket.
Labels pulumi.StringMapInput
// The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
LifecycleRules BucketLifecycleRuleArrayInput
// The [GCS location](https://cloud.google.com/storage/docs/bucket-locations)
Location pulumi.StringPtrInput
// The bucket's [Access & Storage Logs](https://cloud.google.com/storage/docs/access-logs) configuration.
Logging BucketLoggingPtrInput
// The name of the bucket.
Name pulumi.StringPtrInput
// The ID of the project in which the resource belongs. If it
// is not provided, the provider project is used.
Project pulumi.StringPtrInput
// Enables [Requester Pays](https://cloud.google.com/storage/docs/requester-pays) on a storage bucket.
RequesterPays pulumi.BoolPtrInput
// Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
RetentionPolicy BucketRetentionPolicyPtrInput
// The URI of the created resource.
SelfLink pulumi.StringPtrInput
// The target [Storage Class](https://cloud.google.com/storage/docs/storage-classes) of objects affected by this Lifecycle Rule. Supported values include: `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`, `ARCHIVE`.
StorageClass pulumi.StringPtrInput
// Enables [Uniform bucket-level access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) access to a bucket.
UniformBucketLevelAccess pulumi.BoolPtrInput
// The base URL of the bucket, in the format `gs://<bucket-name>`.
Url pulumi.StringPtrInput
// The bucket's [Versioning](https://cloud.google.com/storage/docs/object-versioning) configuration.
Versioning BucketVersioningPtrInput
// Configuration if the bucket acts as a website. Structure is documented below.
Website BucketWebsitePtrInput
}
func (BucketState) ElementType() reflect.Type {
return reflect.TypeOf((*bucketState)(nil)).Elem()
}
type bucketArgs struct {
// Enables [Bucket Policy Only](https://cloud.google.com/storage/docs/bucket-policy-only) access to a bucket. This field will be removed in the next major release of the provider.
//
// Deprecated: Please use the uniform_bucket_level_access as this field has been renamed by Google.
BucketPolicyOnly *bool `pulumi:"bucketPolicyOnly"`
// The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
Cors []BucketCor `pulumi:"cors"`
DefaultEventBasedHold *bool `pulumi:"defaultEventBasedHold"`
// The bucket's encryption configuration.
Encryption *BucketEncryption `pulumi:"encryption"`
// When deleting a bucket, this
// boolean option will delete all contained objects. If you try to delete a
// bucket that contains objects, the provider will fail that run.
ForceDestroy *bool `pulumi:"forceDestroy"`
// A map of key/value label pairs to assign to the bucket.
Labels map[string]string `pulumi:"labels"`
// The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
LifecycleRules []BucketLifecycleRule `pulumi:"lifecycleRules"`
// The [GCS location](https://cloud.google.com/storage/docs/bucket-locations)
Location *string `pulumi:"location"`
// The bucket's [Access & Storage Logs](https://cloud.google.com/storage/docs/access-logs) configuration.
Logging *BucketLogging `pulumi:"logging"`
// The name of the bucket.
Name *string `pulumi:"name"`
// The ID of the project in which the resource belongs. If it
// is not provided, the provider project is used.
Project *string `pulumi:"project"`
// Enables [Requester Pays](https://cloud.google.com/storage/docs/requester-pays) on a storage bucket.
RequesterPays *bool `pulumi:"requesterPays"`
// Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
RetentionPolicy *BucketRetentionPolicy `pulumi:"retentionPolicy"`
// The target [Storage Class](https://cloud.google.com/storage/docs/storage-classes) of objects affected by this Lifecycle Rule. Supported values include: `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`, `ARCHIVE`.
StorageClass *string `pulumi:"storageClass"`
// Enables [Uniform bucket-level access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) access to a bucket.
UniformBucketLevelAccess *bool `pulumi:"uniformBucketLevelAccess"`
// The bucket's [Versioning](https://cloud.google.com/storage/docs/object-versioning) configuration.
Versioning *BucketVersioning `pulumi:"versioning"`
// Configuration if the bucket acts as a website. Structure is documented below.
Website *BucketWebsite `pulumi:"website"`
}
// The set of arguments for constructing a Bucket resource.
type BucketArgs struct {
// Enables [Bucket Policy Only](https://cloud.google.com/storage/docs/bucket-policy-only) access to a bucket. This field will be removed in the next major release of the provider.
//
// Deprecated: Please use the uniform_bucket_level_access as this field has been renamed by Google.
BucketPolicyOnly pulumi.BoolPtrInput
// The bucket's [Cross-Origin Resource Sharing (CORS)](https://www.w3.org/TR/cors/) configuration. Multiple blocks of this type are permitted. Structure is documented below.
Cors BucketCorArrayInput
DefaultEventBasedHold pulumi.BoolPtrInput
// The bucket's encryption configuration.
Encryption BucketEncryptionPtrInput
// When deleting a bucket, this
// boolean option will delete all contained objects. If you try to delete a
// bucket that contains objects, the provider will fail that run.
ForceDestroy pulumi.BoolPtrInput
// A map of key/value label pairs to assign to the bucket.
Labels pulumi.StringMapInput
// The bucket's [Lifecycle Rules](https://cloud.google.com/storage/docs/lifecycle#configuration) configuration. Multiple blocks of this type are permitted. Structure is documented below.
LifecycleRules BucketLifecycleRuleArrayInput
// The [GCS location](https://cloud.google.com/storage/docs/bucket-locations)
Location pulumi.StringPtrInput
// The bucket's [Access & Storage Logs](https://cloud.google.com/storage/docs/access-logs) configuration.
Logging BucketLoggingPtrInput
// The name of the bucket.
Name pulumi.StringPtrInput
// The ID of the project in which the resource belongs. If it
// is not provided, the provider project is used.
Project pulumi.StringPtrInput
// Enables [Requester Pays](https://cloud.google.com/storage/docs/requester-pays) on a storage bucket.
RequesterPays pulumi.BoolPtrInput
// Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. Structure is documented below.
RetentionPolicy BucketRetentionPolicyPtrInput
// The target [Storage Class](https://cloud.google.com/storage/docs/storage-classes) of objects affected by this Lifecycle Rule. Supported values include: `MULTI_REGIONAL`, `REGIONAL`, `NEARLINE`, `COLDLINE`, `ARCHIVE`.
StorageClass pulumi.StringPtrInput
// Enables [Uniform bucket-level access](https://cloud.google.com/storage/docs/uniform-bucket-level-access) access to a bucket.
UniformBucketLevelAccess pulumi.BoolPtrInput
// The bucket's [Versioning](https://cloud.google.com/storage/docs/object-versioning) configuration.
Versioning BucketVersioningPtrInput
// Configuration if the bucket acts as a website. Structure is documented below.
Website BucketWebsitePtrInput
}
func (BucketArgs) ElementType() reflect.Type {
return reflect.TypeOf((*bucketArgs)(nil)).Elem()
}
type BucketInput interface {
pulumi.Input
ToBucketOutput() BucketOutput
ToBucketOutputWithContext(ctx context.Context) BucketOutput
}
func (*Bucket) ElementType() reflect.Type {
return reflect.TypeOf((*Bucket)(nil))
}
func (i *Bucket) ToBucketOutput() BucketOutput {
return i.ToBucketOutputWithContext(context.Background())
}
func (i *Bucket) ToBucketOutputWithContext(ctx context.Context) BucketOutput {
return pulumi.ToOutputWithContext(ctx, i).(BucketOutput)
}
func (i *Bucket) ToBucketPtrOutput() BucketPtrOutput {
return i.ToBucketPtrOutputWithContext(context.Background())
}
func (i *Bucket) ToBucketPtrOutputWithContext(ctx context.Context) BucketPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(BucketPtrOutput)
}
type BucketPtrInput interface {
pulumi.Input
ToBucketPtrOutput() BucketPtrOutput
ToBucketPtrOutputWithContext(ctx context.Context) BucketPtrOutput
}
type bucketPtrType BucketArgs
func (*bucketPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**Bucket)(nil))
}
func (i *bucketPtrType) ToBucketPtrOutput() BucketPtrOutput {
return i.ToBucketPtrOutputWithContext(context.Background())
}
func (i *bucketPtrType) ToBucketPtrOutputWithContext(ctx context.Context) BucketPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(BucketPtrOutput)
}
// BucketArrayInput is an input type that accepts BucketArray and BucketArrayOutput values.
// You can construct a concrete instance of `BucketArrayInput` via:
//
// BucketArray{ BucketArgs{...} }
type BucketArrayInput interface {
pulumi.Input
ToBucketArrayOutput() BucketArrayOutput
ToBucketArrayOutputWithContext(context.Context) BucketArrayOutput
}
type BucketArray []BucketInput
func (BucketArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*Bucket)(nil))
}
func (i BucketArray) ToBucketArrayOutput() BucketArrayOutput {
return i.ToBucketArrayOutputWithContext(context.Background())
}
func (i BucketArray) ToBucketArrayOutputWithContext(ctx context.Context) BucketArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BucketArrayOutput)
}
// BucketMapInput is an input type that accepts BucketMap and BucketMapOutput values.
// You can construct a concrete instance of `BucketMapInput` via:
//
// BucketMap{ "key": BucketArgs{...} }
type BucketMapInput interface {
pulumi.Input
ToBucketMapOutput() BucketMapOutput
ToBucketMapOutputWithContext(context.Context) BucketMapOutput
}
type BucketMap map[string]BucketInput
func (BucketMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*Bucket)(nil))
}
func (i BucketMap) ToBucketMapOutput() BucketMapOutput {
return i.ToBucketMapOutputWithContext(context.Background())
}
func (i BucketMap) ToBucketMapOutputWithContext(ctx context.Context) BucketMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(BucketMapOutput)
}
type BucketOutput struct {
*pulumi.OutputState
}
func (BucketOutput) ElementType() reflect.Type {
return reflect.TypeOf((*Bucket)(nil))
}
func (o BucketOutput) ToBucketOutput() BucketOutput {
return o
}
func (o BucketOutput) ToBucketOutputWithContext(ctx context.Context) BucketOutput {
return o
}
func (o BucketOutput) ToBucketPtrOutput() BucketPtrOutput {
return o.ToBucketPtrOutputWithContext(context.Background())
}
func (o BucketOutput) ToBucketPtrOutputWithContext(ctx context.Context) BucketPtrOutput {
return o.ApplyT(func(v Bucket) *Bucket {
return &v
}).(BucketPtrOutput)
}
type BucketPtrOutput struct {
*pulumi.OutputState
}
func (BucketPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Bucket)(nil))
}
func (o BucketPtrOutput) ToBucketPtrOutput() BucketPtrOutput {
return o
}
func (o BucketPtrOutput) ToBucketPtrOutputWithContext(ctx context.Context) BucketPtrOutput {
return o
}
type BucketArrayOutput struct{ *pulumi.OutputState }
func (BucketArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]Bucket)(nil))
}
func (o BucketArrayOutput) ToBucketArrayOutput() BucketArrayOutput {
return o
}
func (o BucketArrayOutput) ToBucketArrayOutputWithContext(ctx context.Context) BucketArrayOutput {
return o
}
func (o BucketArrayOutput) Index(i pulumi.IntInput) BucketOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) Bucket {
return vs[0].([]Bucket)[vs[1].(int)]
}).(BucketOutput)
}
type BucketMapOutput struct{ *pulumi.OutputState }
func (BucketMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]Bucket)(nil))
}
func (o BucketMapOutput) ToBucketMapOutput() BucketMapOutput {
return o
}
func (o BucketMapOutput) ToBucketMapOutputWithContext(ctx context.Context) BucketMapOutput {
return o
}
func (o BucketMapOutput) MapIndex(k pulumi.StringInput) BucketOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) Bucket {
return vs[0].(map[string]Bucket)[vs[1].(string)]
}).(BucketOutput)
}
func init() {
pulumi.RegisterOutputType(BucketOutput{})
pulumi.RegisterOutputType(BucketPtrOutput{})
pulumi.RegisterOutputType(BucketArrayOutput{})
pulumi.RegisterOutputType(BucketMapOutput{})
}