/
bucketObject.go
611 lines (565 loc) · 38.1 KB
/
bucketObject.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
// *** 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 s3
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a S3 bucket object resource.
//
// ## Example Usage
// ### Encrypting with KMS Key
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/kms"
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/s3"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// examplekms, err := kms.NewKey(ctx, "examplekms", &kms.KeyArgs{
// Description: pulumi.String("KMS key 1"),
// DeletionWindowInDays: pulumi.Int(7),
// })
// if err != nil {
// return err
// }
// examplebucket, err := s3.NewBucket(ctx, "examplebucket", &s3.BucketArgs{
// Acl: pulumi.String("private"),
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketObject(ctx, "examplebucketObject", &s3.BucketObjectArgs{
// Key: pulumi.String("someobject"),
// Bucket: examplebucket.ID(),
// Source: pulumi.NewFileAsset("index.html"),
// KmsKeyId: examplekms.Arn,
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ### Server Side Encryption with S3 Default Master Key
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/s3"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// examplebucket, err := s3.NewBucket(ctx, "examplebucket", &s3.BucketArgs{
// Acl: pulumi.String("private"),
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketObject(ctx, "examplebucketObject", &s3.BucketObjectArgs{
// Key: pulumi.String("someobject"),
// Bucket: examplebucket.ID(),
// Source: pulumi.NewFileAsset("index.html"),
// ServerSideEncryption: pulumi.String("aws:kms"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ### Server Side Encryption with AWS-Managed Key
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/s3"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// examplebucket, err := s3.NewBucket(ctx, "examplebucket", &s3.BucketArgs{
// Acl: pulumi.String("private"),
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketObject(ctx, "examplebucketObject", &s3.BucketObjectArgs{
// Key: pulumi.String("someobject"),
// Bucket: examplebucket.ID(),
// Source: pulumi.NewFileAsset("index.html"),
// ServerSideEncryption: pulumi.String("AES256"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ### S3 Object Lock
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/s3"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// examplebucket, err := s3.NewBucket(ctx, "examplebucket", &s3.BucketArgs{
// Acl: pulumi.String("private"),
// Versioning: &s3.BucketVersioningArgs{
// Enabled: pulumi.Bool(true),
// },
// ObjectLockConfiguration: &s3.BucketObjectLockConfigurationArgs{
// ObjectLockEnabled: pulumi.String("Enabled"),
// },
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketObject(ctx, "examplebucketObject", &s3.BucketObjectArgs{
// Key: pulumi.String("someobject"),
// Bucket: examplebucket.ID(),
// Source: pulumi.NewFileAsset("important.txt"),
// ObjectLockLegalHoldStatus: pulumi.String("ON"),
// ObjectLockMode: pulumi.String("GOVERNANCE"),
// ObjectLockRetainUntilDate: pulumi.String("2021-12-31T23:59:60Z"),
// ForceDestroy: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Objects can be imported using the `id`. The `id` is the bucket name and the key together e.g.,
//
// ```sh
// $ pulumi import aws:s3/bucketObject:BucketObject object some-bucket-name/some/key.txt
// ```
//
// Additionally, s3 url syntax can be used, e.g.,
//
// ```sh
// $ pulumi import aws:s3/bucketObject:BucketObject object s3://some-bucket-name/some/key.txt
// ```
type BucketObject struct {
pulumi.CustomResourceState
// [Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) to apply. Valid values are `private`, `public-read`, `public-read-write`, `aws-exec-read`, `authenticated-read`, `bucket-owner-read`, and `bucket-owner-full-control`. Defaults to `private`.
Acl pulumi.StringPtrOutput `pulumi:"acl"`
// Name of the bucket to put the file in. Alternatively, an [S3 access point](https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) ARN can be specified.
Bucket pulumi.StringOutput `pulumi:"bucket"`
// Whether or not to use [Amazon S3 Bucket Keys](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) for SSE-KMS.
BucketKeyEnabled pulumi.BoolOutput `pulumi:"bucketKeyEnabled"`
// Caching behavior along the request/reply chain Read [w3c cacheControl](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) for further details.
CacheControl pulumi.StringPtrOutput `pulumi:"cacheControl"`
// Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
Content pulumi.StringPtrOutput `pulumi:"content"`
// Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the `gzipbase64` function with small text strings. For larger objects, use `source` to stream the content from a disk file.
ContentBase64 pulumi.StringPtrOutput `pulumi:"contentBase64"`
// Presentational information for the object. Read [w3c contentDisposition](http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1) for further information.
ContentDisposition pulumi.StringPtrOutput `pulumi:"contentDisposition"`
// Content encodings that have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read [w3c content encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11) for further information.
ContentEncoding pulumi.StringPtrOutput `pulumi:"contentEncoding"`
// Language the content is in e.g., en-US or en-GB.
ContentLanguage pulumi.StringPtrOutput `pulumi:"contentLanguage"`
// Standard MIME type describing the format of the object data, e.g., application/octet-stream. All Valid MIME Types are valid for this input.
ContentType pulumi.StringOutput `pulumi:"contentType"`
// Triggers updates when the value changes. The only meaningful value is `filemd5("path/to/file")`. This attribute is not compatible with KMS encryption, `kmsKeyId` or `serverSideEncryption = "aws:kms"` (see `sourceHash` instead).
Etag pulumi.StringOutput `pulumi:"etag"`
// Whether to allow the object to be deleted by removing any legal hold on any object version. Default is `false`. This value should be set to `true` only if the bucket has S3 object lock enabled.
ForceDestroy pulumi.BoolPtrOutput `pulumi:"forceDestroy"`
// Name of the object once it is in the bucket.
Key pulumi.StringOutput `pulumi:"key"`
// ARN of the KMS Key to use for object encryption. If the S3 Bucket has server-side encryption enabled, that value will automatically be used. If referencing the `kms.Key` resource, use the `arn` attribute. If referencing the `kms.Alias` data source or resource, use the `targetKeyArn` attribute. This provider will only perform drift detection if a configuration value is provided.
KmsKeyId pulumi.StringOutput `pulumi:"kmsKeyId"`
// Map of keys/values to provision metadata (will be automatically prefixed by `x-amz-meta-`, note that only lowercase label are currently supported by the AWS Go API).
Metadata pulumi.StringMapOutput `pulumi:"metadata"`
// [Legal hold](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-legal-holds) status that you want to apply to the specified object. Valid values are `ON` and `OFF`.
ObjectLockLegalHoldStatus pulumi.StringPtrOutput `pulumi:"objectLockLegalHoldStatus"`
// Object lock [retention mode](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-modes) that you want to apply to this object. Valid values are `GOVERNANCE` and `COMPLIANCE`.
ObjectLockMode pulumi.StringPtrOutput `pulumi:"objectLockMode"`
// Date and time, in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8), when this object's object lock will [expire](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-periods).
ObjectLockRetainUntilDate pulumi.StringPtrOutput `pulumi:"objectLockRetainUntilDate"`
// Server-side encryption of the object in S3. Valid values are "`AES256`" and "`aws:kms`".
ServerSideEncryption pulumi.StringOutput `pulumi:"serverSideEncryption"`
// Path to a file that will be read and uploaded as raw bytes for the object content.
Source pulumi.AssetOrArchiveOutput `pulumi:"source"`
// Triggers updates like `etag` but useful to address `etag` encryption limitations. Set using `filemd5("path/to/source")`. (The value is only stored in state and not saved by AWS.)
SourceHash pulumi.StringPtrOutput `pulumi:"sourceHash"`
// [Storage Class](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#AmazonS3-PutObject-request-header-StorageClass) for the object. Defaults to "`STANDARD`".
StorageClass pulumi.StringOutput `pulumi:"storageClass"`
// Map of tags to assign to the object. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
// Unique version ID value for the object, if bucket versioning is enabled.
VersionId pulumi.StringOutput `pulumi:"versionId"`
// Target URL for [website redirect](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html).
WebsiteRedirect pulumi.StringPtrOutput `pulumi:"websiteRedirect"`
}
// NewBucketObject registers a new resource with the given unique name, arguments, and options.
func NewBucketObject(ctx *pulumi.Context,
name string, args *BucketObjectArgs, opts ...pulumi.ResourceOption) (*BucketObject, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Bucket == nil {
return nil, errors.New("invalid value for required argument 'Bucket'")
}
var resource BucketObject
err := ctx.RegisterResource("aws:s3/bucketObject:BucketObject", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBucketObject gets an existing BucketObject 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 GetBucketObject(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BucketObjectState, opts ...pulumi.ResourceOption) (*BucketObject, error) {
var resource BucketObject
err := ctx.ReadResource("aws:s3/bucketObject:BucketObject", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering BucketObject resources.
type bucketObjectState struct {
// [Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) to apply. Valid values are `private`, `public-read`, `public-read-write`, `aws-exec-read`, `authenticated-read`, `bucket-owner-read`, and `bucket-owner-full-control`. Defaults to `private`.
Acl *string `pulumi:"acl"`
// Name of the bucket to put the file in. Alternatively, an [S3 access point](https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) ARN can be specified.
Bucket interface{} `pulumi:"bucket"`
// Whether or not to use [Amazon S3 Bucket Keys](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) for SSE-KMS.
BucketKeyEnabled *bool `pulumi:"bucketKeyEnabled"`
// Caching behavior along the request/reply chain Read [w3c cacheControl](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) for further details.
CacheControl *string `pulumi:"cacheControl"`
// Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
Content *string `pulumi:"content"`
// Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the `gzipbase64` function with small text strings. For larger objects, use `source` to stream the content from a disk file.
ContentBase64 *string `pulumi:"contentBase64"`
// Presentational information for the object. Read [w3c contentDisposition](http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1) for further information.
ContentDisposition *string `pulumi:"contentDisposition"`
// Content encodings that have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read [w3c content encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11) for further information.
ContentEncoding *string `pulumi:"contentEncoding"`
// Language the content is in e.g., en-US or en-GB.
ContentLanguage *string `pulumi:"contentLanguage"`
// Standard MIME type describing the format of the object data, e.g., application/octet-stream. All Valid MIME Types are valid for this input.
ContentType *string `pulumi:"contentType"`
// Triggers updates when the value changes. The only meaningful value is `filemd5("path/to/file")`. This attribute is not compatible with KMS encryption, `kmsKeyId` or `serverSideEncryption = "aws:kms"` (see `sourceHash` instead).
Etag *string `pulumi:"etag"`
// Whether to allow the object to be deleted by removing any legal hold on any object version. Default is `false`. This value should be set to `true` only if the bucket has S3 object lock enabled.
ForceDestroy *bool `pulumi:"forceDestroy"`
// Name of the object once it is in the bucket.
Key *string `pulumi:"key"`
// ARN of the KMS Key to use for object encryption. If the S3 Bucket has server-side encryption enabled, that value will automatically be used. If referencing the `kms.Key` resource, use the `arn` attribute. If referencing the `kms.Alias` data source or resource, use the `targetKeyArn` attribute. This provider will only perform drift detection if a configuration value is provided.
KmsKeyId *string `pulumi:"kmsKeyId"`
// Map of keys/values to provision metadata (will be automatically prefixed by `x-amz-meta-`, note that only lowercase label are currently supported by the AWS Go API).
Metadata map[string]string `pulumi:"metadata"`
// [Legal hold](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-legal-holds) status that you want to apply to the specified object. Valid values are `ON` and `OFF`.
ObjectLockLegalHoldStatus *string `pulumi:"objectLockLegalHoldStatus"`
// Object lock [retention mode](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-modes) that you want to apply to this object. Valid values are `GOVERNANCE` and `COMPLIANCE`.
ObjectLockMode *string `pulumi:"objectLockMode"`
// Date and time, in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8), when this object's object lock will [expire](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-periods).
ObjectLockRetainUntilDate *string `pulumi:"objectLockRetainUntilDate"`
// Server-side encryption of the object in S3. Valid values are "`AES256`" and "`aws:kms`".
ServerSideEncryption *string `pulumi:"serverSideEncryption"`
// Path to a file that will be read and uploaded as raw bytes for the object content.
Source pulumi.AssetOrArchive `pulumi:"source"`
// Triggers updates like `etag` but useful to address `etag` encryption limitations. Set using `filemd5("path/to/source")`. (The value is only stored in state and not saved by AWS.)
SourceHash *string `pulumi:"sourceHash"`
// [Storage Class](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#AmazonS3-PutObject-request-header-StorageClass) for the object. Defaults to "`STANDARD`".
StorageClass *string `pulumi:"storageClass"`
// Map of tags to assign to the object. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll map[string]string `pulumi:"tagsAll"`
// Unique version ID value for the object, if bucket versioning is enabled.
VersionId *string `pulumi:"versionId"`
// Target URL for [website redirect](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html).
WebsiteRedirect *string `pulumi:"websiteRedirect"`
}
type BucketObjectState struct {
// [Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) to apply. Valid values are `private`, `public-read`, `public-read-write`, `aws-exec-read`, `authenticated-read`, `bucket-owner-read`, and `bucket-owner-full-control`. Defaults to `private`.
Acl pulumi.StringPtrInput
// Name of the bucket to put the file in. Alternatively, an [S3 access point](https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) ARN can be specified.
Bucket pulumi.Input
// Whether or not to use [Amazon S3 Bucket Keys](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) for SSE-KMS.
BucketKeyEnabled pulumi.BoolPtrInput
// Caching behavior along the request/reply chain Read [w3c cacheControl](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) for further details.
CacheControl pulumi.StringPtrInput
// Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
Content pulumi.StringPtrInput
// Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the `gzipbase64` function with small text strings. For larger objects, use `source` to stream the content from a disk file.
ContentBase64 pulumi.StringPtrInput
// Presentational information for the object. Read [w3c contentDisposition](http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1) for further information.
ContentDisposition pulumi.StringPtrInput
// Content encodings that have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read [w3c content encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11) for further information.
ContentEncoding pulumi.StringPtrInput
// Language the content is in e.g., en-US or en-GB.
ContentLanguage pulumi.StringPtrInput
// Standard MIME type describing the format of the object data, e.g., application/octet-stream. All Valid MIME Types are valid for this input.
ContentType pulumi.StringPtrInput
// Triggers updates when the value changes. The only meaningful value is `filemd5("path/to/file")`. This attribute is not compatible with KMS encryption, `kmsKeyId` or `serverSideEncryption = "aws:kms"` (see `sourceHash` instead).
Etag pulumi.StringPtrInput
// Whether to allow the object to be deleted by removing any legal hold on any object version. Default is `false`. This value should be set to `true` only if the bucket has S3 object lock enabled.
ForceDestroy pulumi.BoolPtrInput
// Name of the object once it is in the bucket.
Key pulumi.StringPtrInput
// ARN of the KMS Key to use for object encryption. If the S3 Bucket has server-side encryption enabled, that value will automatically be used. If referencing the `kms.Key` resource, use the `arn` attribute. If referencing the `kms.Alias` data source or resource, use the `targetKeyArn` attribute. This provider will only perform drift detection if a configuration value is provided.
KmsKeyId pulumi.StringPtrInput
// Map of keys/values to provision metadata (will be automatically prefixed by `x-amz-meta-`, note that only lowercase label are currently supported by the AWS Go API).
Metadata pulumi.StringMapInput
// [Legal hold](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-legal-holds) status that you want to apply to the specified object. Valid values are `ON` and `OFF`.
ObjectLockLegalHoldStatus pulumi.StringPtrInput
// Object lock [retention mode](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-modes) that you want to apply to this object. Valid values are `GOVERNANCE` and `COMPLIANCE`.
ObjectLockMode pulumi.StringPtrInput
// Date and time, in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8), when this object's object lock will [expire](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-periods).
ObjectLockRetainUntilDate pulumi.StringPtrInput
// Server-side encryption of the object in S3. Valid values are "`AES256`" and "`aws:kms`".
ServerSideEncryption pulumi.StringPtrInput
// Path to a file that will be read and uploaded as raw bytes for the object content.
Source pulumi.AssetOrArchiveInput
// Triggers updates like `etag` but useful to address `etag` encryption limitations. Set using `filemd5("path/to/source")`. (The value is only stored in state and not saved by AWS.)
SourceHash pulumi.StringPtrInput
// [Storage Class](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#AmazonS3-PutObject-request-header-StorageClass) for the object. Defaults to "`STANDARD`".
StorageClass pulumi.StringPtrInput
// Map of tags to assign to the object. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll pulumi.StringMapInput
// Unique version ID value for the object, if bucket versioning is enabled.
VersionId pulumi.StringPtrInput
// Target URL for [website redirect](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html).
WebsiteRedirect pulumi.StringPtrInput
}
func (BucketObjectState) ElementType() reflect.Type {
return reflect.TypeOf((*bucketObjectState)(nil)).Elem()
}
type bucketObjectArgs struct {
// [Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) to apply. Valid values are `private`, `public-read`, `public-read-write`, `aws-exec-read`, `authenticated-read`, `bucket-owner-read`, and `bucket-owner-full-control`. Defaults to `private`.
Acl *string `pulumi:"acl"`
// Name of the bucket to put the file in. Alternatively, an [S3 access point](https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) ARN can be specified.
Bucket interface{} `pulumi:"bucket"`
// Whether or not to use [Amazon S3 Bucket Keys](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) for SSE-KMS.
BucketKeyEnabled *bool `pulumi:"bucketKeyEnabled"`
// Caching behavior along the request/reply chain Read [w3c cacheControl](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) for further details.
CacheControl *string `pulumi:"cacheControl"`
// Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
Content *string `pulumi:"content"`
// Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the `gzipbase64` function with small text strings. For larger objects, use `source` to stream the content from a disk file.
ContentBase64 *string `pulumi:"contentBase64"`
// Presentational information for the object. Read [w3c contentDisposition](http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1) for further information.
ContentDisposition *string `pulumi:"contentDisposition"`
// Content encodings that have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read [w3c content encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11) for further information.
ContentEncoding *string `pulumi:"contentEncoding"`
// Language the content is in e.g., en-US or en-GB.
ContentLanguage *string `pulumi:"contentLanguage"`
// Standard MIME type describing the format of the object data, e.g., application/octet-stream. All Valid MIME Types are valid for this input.
ContentType *string `pulumi:"contentType"`
// Triggers updates when the value changes. The only meaningful value is `filemd5("path/to/file")`. This attribute is not compatible with KMS encryption, `kmsKeyId` or `serverSideEncryption = "aws:kms"` (see `sourceHash` instead).
Etag *string `pulumi:"etag"`
// Whether to allow the object to be deleted by removing any legal hold on any object version. Default is `false`. This value should be set to `true` only if the bucket has S3 object lock enabled.
ForceDestroy *bool `pulumi:"forceDestroy"`
// Name of the object once it is in the bucket.
Key *string `pulumi:"key"`
// ARN of the KMS Key to use for object encryption. If the S3 Bucket has server-side encryption enabled, that value will automatically be used. If referencing the `kms.Key` resource, use the `arn` attribute. If referencing the `kms.Alias` data source or resource, use the `targetKeyArn` attribute. This provider will only perform drift detection if a configuration value is provided.
KmsKeyId *string `pulumi:"kmsKeyId"`
// Map of keys/values to provision metadata (will be automatically prefixed by `x-amz-meta-`, note that only lowercase label are currently supported by the AWS Go API).
Metadata map[string]string `pulumi:"metadata"`
// [Legal hold](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-legal-holds) status that you want to apply to the specified object. Valid values are `ON` and `OFF`.
ObjectLockLegalHoldStatus *string `pulumi:"objectLockLegalHoldStatus"`
// Object lock [retention mode](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-modes) that you want to apply to this object. Valid values are `GOVERNANCE` and `COMPLIANCE`.
ObjectLockMode *string `pulumi:"objectLockMode"`
// Date and time, in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8), when this object's object lock will [expire](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-periods).
ObjectLockRetainUntilDate *string `pulumi:"objectLockRetainUntilDate"`
// Server-side encryption of the object in S3. Valid values are "`AES256`" and "`aws:kms`".
ServerSideEncryption *string `pulumi:"serverSideEncryption"`
// Path to a file that will be read and uploaded as raw bytes for the object content.
Source pulumi.AssetOrArchive `pulumi:"source"`
// Triggers updates like `etag` but useful to address `etag` encryption limitations. Set using `filemd5("path/to/source")`. (The value is only stored in state and not saved by AWS.)
SourceHash *string `pulumi:"sourceHash"`
// [Storage Class](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#AmazonS3-PutObject-request-header-StorageClass) for the object. Defaults to "`STANDARD`".
StorageClass *string `pulumi:"storageClass"`
// Map of tags to assign to the object. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// Target URL for [website redirect](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html).
WebsiteRedirect *string `pulumi:"websiteRedirect"`
}
// The set of arguments for constructing a BucketObject resource.
type BucketObjectArgs struct {
// [Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl) to apply. Valid values are `private`, `public-read`, `public-read-write`, `aws-exec-read`, `authenticated-read`, `bucket-owner-read`, and `bucket-owner-full-control`. Defaults to `private`.
Acl pulumi.StringPtrInput
// Name of the bucket to put the file in. Alternatively, an [S3 access point](https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) ARN can be specified.
Bucket pulumi.Input
// Whether or not to use [Amazon S3 Bucket Keys](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) for SSE-KMS.
BucketKeyEnabled pulumi.BoolPtrInput
// Caching behavior along the request/reply chain Read [w3c cacheControl](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) for further details.
CacheControl pulumi.StringPtrInput
// Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
Content pulumi.StringPtrInput
// Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the `gzipbase64` function with small text strings. For larger objects, use `source` to stream the content from a disk file.
ContentBase64 pulumi.StringPtrInput
// Presentational information for the object. Read [w3c contentDisposition](http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1) for further information.
ContentDisposition pulumi.StringPtrInput
// Content encodings that have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read [w3c content encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11) for further information.
ContentEncoding pulumi.StringPtrInput
// Language the content is in e.g., en-US or en-GB.
ContentLanguage pulumi.StringPtrInput
// Standard MIME type describing the format of the object data, e.g., application/octet-stream. All Valid MIME Types are valid for this input.
ContentType pulumi.StringPtrInput
// Triggers updates when the value changes. The only meaningful value is `filemd5("path/to/file")`. This attribute is not compatible with KMS encryption, `kmsKeyId` or `serverSideEncryption = "aws:kms"` (see `sourceHash` instead).
Etag pulumi.StringPtrInput
// Whether to allow the object to be deleted by removing any legal hold on any object version. Default is `false`. This value should be set to `true` only if the bucket has S3 object lock enabled.
ForceDestroy pulumi.BoolPtrInput
// Name of the object once it is in the bucket.
Key pulumi.StringPtrInput
// ARN of the KMS Key to use for object encryption. If the S3 Bucket has server-side encryption enabled, that value will automatically be used. If referencing the `kms.Key` resource, use the `arn` attribute. If referencing the `kms.Alias` data source or resource, use the `targetKeyArn` attribute. This provider will only perform drift detection if a configuration value is provided.
KmsKeyId pulumi.StringPtrInput
// Map of keys/values to provision metadata (will be automatically prefixed by `x-amz-meta-`, note that only lowercase label are currently supported by the AWS Go API).
Metadata pulumi.StringMapInput
// [Legal hold](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-legal-holds) status that you want to apply to the specified object. Valid values are `ON` and `OFF`.
ObjectLockLegalHoldStatus pulumi.StringPtrInput
// Object lock [retention mode](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-modes) that you want to apply to this object. Valid values are `GOVERNANCE` and `COMPLIANCE`.
ObjectLockMode pulumi.StringPtrInput
// Date and time, in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8), when this object's object lock will [expire](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-periods).
ObjectLockRetainUntilDate pulumi.StringPtrInput
// Server-side encryption of the object in S3. Valid values are "`AES256`" and "`aws:kms`".
ServerSideEncryption pulumi.StringPtrInput
// Path to a file that will be read and uploaded as raw bytes for the object content.
Source pulumi.AssetOrArchiveInput
// Triggers updates like `etag` but useful to address `etag` encryption limitations. Set using `filemd5("path/to/source")`. (The value is only stored in state and not saved by AWS.)
SourceHash pulumi.StringPtrInput
// [Storage Class](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#AmazonS3-PutObject-request-header-StorageClass) for the object. Defaults to "`STANDARD`".
StorageClass pulumi.StringPtrInput
// Map of tags to assign to the object. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// Target URL for [website redirect](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html).
WebsiteRedirect pulumi.StringPtrInput
}
func (BucketObjectArgs) ElementType() reflect.Type {
return reflect.TypeOf((*bucketObjectArgs)(nil)).Elem()
}
type BucketObjectInput interface {
pulumi.Input
ToBucketObjectOutput() BucketObjectOutput
ToBucketObjectOutputWithContext(ctx context.Context) BucketObjectOutput
}
func (*BucketObject) ElementType() reflect.Type {
return reflect.TypeOf((**BucketObject)(nil)).Elem()
}
func (i *BucketObject) ToBucketObjectOutput() BucketObjectOutput {
return i.ToBucketObjectOutputWithContext(context.Background())
}
func (i *BucketObject) ToBucketObjectOutputWithContext(ctx context.Context) BucketObjectOutput {
return pulumi.ToOutputWithContext(ctx, i).(BucketObjectOutput)
}
// BucketObjectArrayInput is an input type that accepts BucketObjectArray and BucketObjectArrayOutput values.
// You can construct a concrete instance of `BucketObjectArrayInput` via:
//
// BucketObjectArray{ BucketObjectArgs{...} }
type BucketObjectArrayInput interface {
pulumi.Input
ToBucketObjectArrayOutput() BucketObjectArrayOutput
ToBucketObjectArrayOutputWithContext(context.Context) BucketObjectArrayOutput
}
type BucketObjectArray []BucketObjectInput
func (BucketObjectArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BucketObject)(nil)).Elem()
}
func (i BucketObjectArray) ToBucketObjectArrayOutput() BucketObjectArrayOutput {
return i.ToBucketObjectArrayOutputWithContext(context.Background())
}
func (i BucketObjectArray) ToBucketObjectArrayOutputWithContext(ctx context.Context) BucketObjectArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BucketObjectArrayOutput)
}
// BucketObjectMapInput is an input type that accepts BucketObjectMap and BucketObjectMapOutput values.
// You can construct a concrete instance of `BucketObjectMapInput` via:
//
// BucketObjectMap{ "key": BucketObjectArgs{...} }
type BucketObjectMapInput interface {
pulumi.Input
ToBucketObjectMapOutput() BucketObjectMapOutput
ToBucketObjectMapOutputWithContext(context.Context) BucketObjectMapOutput
}
type BucketObjectMap map[string]BucketObjectInput
func (BucketObjectMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BucketObject)(nil)).Elem()
}
func (i BucketObjectMap) ToBucketObjectMapOutput() BucketObjectMapOutput {
return i.ToBucketObjectMapOutputWithContext(context.Background())
}
func (i BucketObjectMap) ToBucketObjectMapOutputWithContext(ctx context.Context) BucketObjectMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(BucketObjectMapOutput)
}
type BucketObjectOutput struct{ *pulumi.OutputState }
func (BucketObjectOutput) ElementType() reflect.Type {
return reflect.TypeOf((**BucketObject)(nil)).Elem()
}
func (o BucketObjectOutput) ToBucketObjectOutput() BucketObjectOutput {
return o
}
func (o BucketObjectOutput) ToBucketObjectOutputWithContext(ctx context.Context) BucketObjectOutput {
return o
}
type BucketObjectArrayOutput struct{ *pulumi.OutputState }
func (BucketObjectArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BucketObject)(nil)).Elem()
}
func (o BucketObjectArrayOutput) ToBucketObjectArrayOutput() BucketObjectArrayOutput {
return o
}
func (o BucketObjectArrayOutput) ToBucketObjectArrayOutputWithContext(ctx context.Context) BucketObjectArrayOutput {
return o
}
func (o BucketObjectArrayOutput) Index(i pulumi.IntInput) BucketObjectOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *BucketObject {
return vs[0].([]*BucketObject)[vs[1].(int)]
}).(BucketObjectOutput)
}
type BucketObjectMapOutput struct{ *pulumi.OutputState }
func (BucketObjectMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BucketObject)(nil)).Elem()
}
func (o BucketObjectMapOutput) ToBucketObjectMapOutput() BucketObjectMapOutput {
return o
}
func (o BucketObjectMapOutput) ToBucketObjectMapOutputWithContext(ctx context.Context) BucketObjectMapOutput {
return o
}
func (o BucketObjectMapOutput) MapIndex(k pulumi.StringInput) BucketObjectOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *BucketObject {
return vs[0].(map[string]*BucketObject)[vs[1].(string)]
}).(BucketObjectOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*BucketObjectInput)(nil)).Elem(), &BucketObject{})
pulumi.RegisterInputType(reflect.TypeOf((*BucketObjectArrayInput)(nil)).Elem(), BucketObjectArray{})
pulumi.RegisterInputType(reflect.TypeOf((*BucketObjectMapInput)(nil)).Elem(), BucketObjectMap{})
pulumi.RegisterOutputType(BucketObjectOutput{})
pulumi.RegisterOutputType(BucketObjectArrayOutput{})
pulumi.RegisterOutputType(BucketObjectMapOutput{})
}