/
bucketObjectv2.go
1026 lines (947 loc) · 60.3 KB
/
bucketObjectv2.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// 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 s3
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an S3 object resource.
//
// ## Example Usage
//
// ### Uploading a file to a bucket
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
// "github.com/pulumi/pulumi-std/sdk/go/std"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// invokeFilemd5, err := std.Filemd5(ctx, &std.Filemd5Args{
// Input: "path/to/file",
// }, nil)
// if err != nil {
// return err
// }
// _, err = s3.NewBucketObjectv2(ctx, "object", &s3.BucketObjectv2Args{
// Bucket: pulumi.Any("your_bucket_name"),
// Key: pulumi.String("new_object_key"),
// Source: pulumi.NewFileAsset("path/to/file"),
// Etag: invokeFilemd5.Result,
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Encrypting with KMS Key
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms"
// "github.com/pulumi/pulumi-aws/sdk/v6/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.NewBucketV2(ctx, "examplebucket", &s3.BucketV2Args{
// Bucket: pulumi.String("examplebuckettftest"),
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketAclV2(ctx, "example", &s3.BucketAclV2Args{
// Bucket: examplebucket.ID(),
// Acl: pulumi.String("private"),
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketObjectv2(ctx, "example", &s3.BucketObjectv2Args{
// Key: pulumi.String("someobject"),
// Bucket: examplebucket.ID(),
// Source: pulumi.NewFileAsset("index.html"),
// KmsKeyId: examplekms.Arn,
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Server Side Encryption with S3 Default Master Key
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// examplebucket, err := s3.NewBucketV2(ctx, "examplebucket", &s3.BucketV2Args{
// Bucket: pulumi.String("examplebuckettftest"),
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketAclV2(ctx, "example", &s3.BucketAclV2Args{
// Bucket: examplebucket.ID(),
// Acl: pulumi.String("private"),
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketObjectv2(ctx, "example", &s3.BucketObjectv2Args{
// Key: pulumi.String("someobject"),
// Bucket: examplebucket.ID(),
// Source: pulumi.NewFileAsset("index.html"),
// ServerSideEncryption: pulumi.String("aws:kms"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Server Side Encryption with AWS-Managed Key
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// examplebucket, err := s3.NewBucketV2(ctx, "examplebucket", &s3.BucketV2Args{
// Bucket: pulumi.String("examplebuckettftest"),
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketAclV2(ctx, "example", &s3.BucketAclV2Args{
// Bucket: examplebucket.ID(),
// Acl: pulumi.String("private"),
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketObjectv2(ctx, "example", &s3.BucketObjectv2Args{
// Key: pulumi.String("someobject"),
// Bucket: examplebucket.ID(),
// Source: pulumi.NewFileAsset("index.html"),
// ServerSideEncryption: pulumi.String("AES256"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### S3 Object Lock
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// examplebucket, err := s3.NewBucketV2(ctx, "examplebucket", &s3.BucketV2Args{
// Bucket: pulumi.String("examplebuckettftest"),
// ObjectLockEnabled: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketAclV2(ctx, "example", &s3.BucketAclV2Args{
// Bucket: examplebucket.ID(),
// Acl: pulumi.String("private"),
// })
// if err != nil {
// return err
// }
// exampleBucketVersioningV2, err := s3.NewBucketVersioningV2(ctx, "example", &s3.BucketVersioningV2Args{
// Bucket: examplebucket.ID(),
// VersioningConfiguration: &s3.BucketVersioningV2VersioningConfigurationArgs{
// Status: pulumi.String("Enabled"),
// },
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketObjectv2(ctx, "examplebucket_object", &s3.BucketObjectv2Args{
// 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),
// }, pulumi.DependsOn([]pulumi.Resource{
// exampleBucketVersioningV2,
// }))
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ### Ignoring Provider `defaultTags`
//
// S3 objects support a [maximum of 10 tags](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html).
// If the resource's own `tags` and the provider-level `defaultTags` would together lead to more than 10 tags on an S3 object, use the `overrideProvider` configuration block to suppress any provider-level `defaultTags`.
//
// > S3 objects stored in Amazon S3 Express directory buckets do not support tags, so any provider-level `defaultTags` must be suppressed.
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// examplebucket, err := s3.NewBucketV2(ctx, "examplebucket", &s3.BucketV2Args{
// Bucket: pulumi.String("examplebuckettftest"),
// })
// if err != nil {
// return err
// }
// _, err = s3.NewBucketObjectv2(ctx, "examplebucket_object", &s3.BucketObjectv2Args{
// Key: pulumi.String("someobject"),
// Bucket: examplebucket.ID(),
// Source: pulumi.NewFileAsset("important.txt"),
// Tags: pulumi.StringMap{
// "Env": pulumi.String("test"),
// },
// OverrideProvider: &s3.BucketObjectv2OverrideProviderArgs{
// DefaultTags: &s3.BucketObjectv2OverrideProviderDefaultTagsArgs{
// Tags: nil,
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Import using S3 URL syntax:
//
// __Using `pulumi import` to import__ objects using the `id` or S3 URL. For example:
//
// Import using the `id`, which is the bucket name and the key together:
//
// ```sh
// $ pulumi import aws:s3/bucketObjectv2:BucketObjectv2 example some-bucket-name/some/key.txt
// ```
// Import using S3 URL syntax:
//
// ```sh
// $ pulumi import aws:s3/bucketObjectv2:BucketObjectv2 example s3://some-bucket-name/some/key.txt
// ```
type BucketObjectv2 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`.
Acl pulumi.StringOutput `pulumi:"acl"`
// ARN of the object.
Arn pulumi.StringOutput `pulumi:"arn"`
// 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"`
// Indicates the algorithm used to create the checksum for the object. If a value is specified and the object is encrypted with KMS, you must have permission to use the `kms:Decrypt` action. Valid values: `CRC32`, `CRC32C`, `SHA1`, `SHA256`.
ChecksumAlgorithm pulumi.StringPtrOutput `pulumi:"checksumAlgorithm"`
// The base64-encoded, 32-bit CRC32 checksum of the object.
ChecksumCrc32 pulumi.StringOutput `pulumi:"checksumCrc32"`
// The base64-encoded, 32-bit CRC32C checksum of the object.
ChecksumCrc32c pulumi.StringOutput `pulumi:"checksumCrc32c"`
// The base64-encoded, 160-bit SHA-1 digest of the object.
ChecksumSha1 pulumi.StringOutput `pulumi:"checksumSha1"`
// The base64-encoded, 256-bit SHA-256 digest of the object.
ChecksumSha256 pulumi.StringOutput `pulumi:"checksumSha256"`
// 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. This attribute is not compatible with KMS encryption, `kmsKeyId` or `serverSideEncryption = "aws:kms"`, also if an object is larger than 16 MB, the AWS Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest (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.
//
// The following arguments are optional:
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. The 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"`
// Override provider-level configuration options. See Override Provider below for more details.
OverrideProvider BucketObjectv2OverrideProviderPtrOutput `pulumi:"overrideProvider"`
// 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. (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.
//
// Deprecated: Please use `tags` instead.
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).
//
// If no content is provided through `source`, `content` or `contentBase64`, then the object will be empty.
//
// > **Note:** The provider ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`.
WebsiteRedirect pulumi.StringPtrOutput `pulumi:"websiteRedirect"`
}
// NewBucketObjectv2 registers a new resource with the given unique name, arguments, and options.
func NewBucketObjectv2(ctx *pulumi.Context,
name string, args *BucketObjectv2Args, opts ...pulumi.ResourceOption) (*BucketObjectv2, 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'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("aws:s3/BucketObject:BucketObject"),
},
})
opts = append(opts, aliases)
opts = internal.PkgResourceDefaultOpts(opts)
var resource BucketObjectv2
err := ctx.RegisterResource("aws:s3/bucketObjectv2:BucketObjectv2", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBucketObjectv2 gets an existing BucketObjectv2 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 GetBucketObjectv2(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BucketObjectv2State, opts ...pulumi.ResourceOption) (*BucketObjectv2, error) {
var resource BucketObjectv2
err := ctx.ReadResource("aws:s3/bucketObjectv2:BucketObjectv2", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering BucketObjectv2 resources.
type bucketObjectv2State 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`.
Acl *string `pulumi:"acl"`
// ARN of the object.
Arn *string `pulumi:"arn"`
// 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"`
// Indicates the algorithm used to create the checksum for the object. If a value is specified and the object is encrypted with KMS, you must have permission to use the `kms:Decrypt` action. Valid values: `CRC32`, `CRC32C`, `SHA1`, `SHA256`.
ChecksumAlgorithm *string `pulumi:"checksumAlgorithm"`
// The base64-encoded, 32-bit CRC32 checksum of the object.
ChecksumCrc32 *string `pulumi:"checksumCrc32"`
// The base64-encoded, 32-bit CRC32C checksum of the object.
ChecksumCrc32c *string `pulumi:"checksumCrc32c"`
// The base64-encoded, 160-bit SHA-1 digest of the object.
ChecksumSha1 *string `pulumi:"checksumSha1"`
// The base64-encoded, 256-bit SHA-256 digest of the object.
ChecksumSha256 *string `pulumi:"checksumSha256"`
// 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. This attribute is not compatible with KMS encryption, `kmsKeyId` or `serverSideEncryption = "aws:kms"`, also if an object is larger than 16 MB, the AWS Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest (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.
//
// The following arguments are optional:
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. The 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"`
// Override provider-level configuration options. See Override Provider below for more details.
OverrideProvider *BucketObjectv2OverrideProvider `pulumi:"overrideProvider"`
// 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. (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.
//
// Deprecated: Please use `tags` instead.
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).
//
// If no content is provided through `source`, `content` or `contentBase64`, then the object will be empty.
//
// > **Note:** The provider ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`.
WebsiteRedirect *string `pulumi:"websiteRedirect"`
}
type BucketObjectv2State 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`.
Acl pulumi.StringPtrInput
// ARN of the object.
Arn 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
// Indicates the algorithm used to create the checksum for the object. If a value is specified and the object is encrypted with KMS, you must have permission to use the `kms:Decrypt` action. Valid values: `CRC32`, `CRC32C`, `SHA1`, `SHA256`.
ChecksumAlgorithm pulumi.StringPtrInput
// The base64-encoded, 32-bit CRC32 checksum of the object.
ChecksumCrc32 pulumi.StringPtrInput
// The base64-encoded, 32-bit CRC32C checksum of the object.
ChecksumCrc32c pulumi.StringPtrInput
// The base64-encoded, 160-bit SHA-1 digest of the object.
ChecksumSha1 pulumi.StringPtrInput
// The base64-encoded, 256-bit SHA-256 digest of the object.
ChecksumSha256 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. This attribute is not compatible with KMS encryption, `kmsKeyId` or `serverSideEncryption = "aws:kms"`, also if an object is larger than 16 MB, the AWS Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest (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.
//
// The following arguments are optional:
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. The 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
// Override provider-level configuration options. See Override Provider below for more details.
OverrideProvider BucketObjectv2OverrideProviderPtrInput
// 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. (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.
//
// Deprecated: Please use `tags` instead.
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).
//
// If no content is provided through `source`, `content` or `contentBase64`, then the object will be empty.
//
// > **Note:** The provider ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`.
WebsiteRedirect pulumi.StringPtrInput
}
func (BucketObjectv2State) ElementType() reflect.Type {
return reflect.TypeOf((*bucketObjectv2State)(nil)).Elem()
}
type bucketObjectv2Args 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`.
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"`
// Indicates the algorithm used to create the checksum for the object. If a value is specified and the object is encrypted with KMS, you must have permission to use the `kms:Decrypt` action. Valid values: `CRC32`, `CRC32C`, `SHA1`, `SHA256`.
ChecksumAlgorithm *string `pulumi:"checksumAlgorithm"`
// 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. This attribute is not compatible with KMS encryption, `kmsKeyId` or `serverSideEncryption = "aws:kms"`, also if an object is larger than 16 MB, the AWS Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest (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.
//
// The following arguments are optional:
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. The 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"`
// Override provider-level configuration options. See Override Provider below for more details.
OverrideProvider *BucketObjectv2OverrideProvider `pulumi:"overrideProvider"`
// 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. (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).
//
// If no content is provided through `source`, `content` or `contentBase64`, then the object will be empty.
//
// > **Note:** The provider ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`.
WebsiteRedirect *string `pulumi:"websiteRedirect"`
}
// The set of arguments for constructing a BucketObjectv2 resource.
type BucketObjectv2Args 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`.
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
// Indicates the algorithm used to create the checksum for the object. If a value is specified and the object is encrypted with KMS, you must have permission to use the `kms:Decrypt` action. Valid values: `CRC32`, `CRC32C`, `SHA1`, `SHA256`.
ChecksumAlgorithm 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. This attribute is not compatible with KMS encryption, `kmsKeyId` or `serverSideEncryption = "aws:kms"`, also if an object is larger than 16 MB, the AWS Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest (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.
//
// The following arguments are optional:
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. The 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
// Override provider-level configuration options. See Override Provider below for more details.
OverrideProvider BucketObjectv2OverrideProviderPtrInput
// 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. (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).
//
// If no content is provided through `source`, `content` or `contentBase64`, then the object will be empty.
//
// > **Note:** The provider ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`.
WebsiteRedirect pulumi.StringPtrInput
}
func (BucketObjectv2Args) ElementType() reflect.Type {
return reflect.TypeOf((*bucketObjectv2Args)(nil)).Elem()
}
type BucketObjectv2Input interface {
pulumi.Input
ToBucketObjectv2Output() BucketObjectv2Output
ToBucketObjectv2OutputWithContext(ctx context.Context) BucketObjectv2Output
}
func (*BucketObjectv2) ElementType() reflect.Type {
return reflect.TypeOf((**BucketObjectv2)(nil)).Elem()
}
func (i *BucketObjectv2) ToBucketObjectv2Output() BucketObjectv2Output {
return i.ToBucketObjectv2OutputWithContext(context.Background())
}
func (i *BucketObjectv2) ToBucketObjectv2OutputWithContext(ctx context.Context) BucketObjectv2Output {
return pulumi.ToOutputWithContext(ctx, i).(BucketObjectv2Output)
}
// BucketObjectv2ArrayInput is an input type that accepts BucketObjectv2Array and BucketObjectv2ArrayOutput values.
// You can construct a concrete instance of `BucketObjectv2ArrayInput` via:
//
// BucketObjectv2Array{ BucketObjectv2Args{...} }
type BucketObjectv2ArrayInput interface {
pulumi.Input
ToBucketObjectv2ArrayOutput() BucketObjectv2ArrayOutput
ToBucketObjectv2ArrayOutputWithContext(context.Context) BucketObjectv2ArrayOutput
}
type BucketObjectv2Array []BucketObjectv2Input
func (BucketObjectv2Array) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BucketObjectv2)(nil)).Elem()
}
func (i BucketObjectv2Array) ToBucketObjectv2ArrayOutput() BucketObjectv2ArrayOutput {
return i.ToBucketObjectv2ArrayOutputWithContext(context.Background())
}
func (i BucketObjectv2Array) ToBucketObjectv2ArrayOutputWithContext(ctx context.Context) BucketObjectv2ArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BucketObjectv2ArrayOutput)
}
// BucketObjectv2MapInput is an input type that accepts BucketObjectv2Map and BucketObjectv2MapOutput values.
// You can construct a concrete instance of `BucketObjectv2MapInput` via:
//
// BucketObjectv2Map{ "key": BucketObjectv2Args{...} }
type BucketObjectv2MapInput interface {
pulumi.Input
ToBucketObjectv2MapOutput() BucketObjectv2MapOutput
ToBucketObjectv2MapOutputWithContext(context.Context) BucketObjectv2MapOutput
}
type BucketObjectv2Map map[string]BucketObjectv2Input
func (BucketObjectv2Map) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BucketObjectv2)(nil)).Elem()
}
func (i BucketObjectv2Map) ToBucketObjectv2MapOutput() BucketObjectv2MapOutput {
return i.ToBucketObjectv2MapOutputWithContext(context.Background())
}
func (i BucketObjectv2Map) ToBucketObjectv2MapOutputWithContext(ctx context.Context) BucketObjectv2MapOutput {
return pulumi.ToOutputWithContext(ctx, i).(BucketObjectv2MapOutput)
}
type BucketObjectv2Output struct{ *pulumi.OutputState }
func (BucketObjectv2Output) ElementType() reflect.Type {
return reflect.TypeOf((**BucketObjectv2)(nil)).Elem()
}
func (o BucketObjectv2Output) ToBucketObjectv2Output() BucketObjectv2Output {
return o
}
func (o BucketObjectv2Output) ToBucketObjectv2OutputWithContext(ctx context.Context) BucketObjectv2Output {
return o
}
// [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`.
func (o BucketObjectv2Output) Acl() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.Acl }).(pulumi.StringOutput)
}
// ARN of the object.
func (o BucketObjectv2Output) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// 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.
func (o BucketObjectv2Output) Bucket() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.Bucket }).(pulumi.StringOutput)
}
// Whether or not to use [Amazon S3 Bucket Keys](https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) for SSE-KMS.
func (o BucketObjectv2Output) BucketKeyEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.BoolOutput { return v.BucketKeyEnabled }).(pulumi.BoolOutput)
}
// Caching behavior along the request/reply chain Read [w3c cacheControl](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) for further details.
func (o BucketObjectv2Output) CacheControl() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringPtrOutput { return v.CacheControl }).(pulumi.StringPtrOutput)
}
// Indicates the algorithm used to create the checksum for the object. If a value is specified and the object is encrypted with KMS, you must have permission to use the `kms:Decrypt` action. Valid values: `CRC32`, `CRC32C`, `SHA1`, `SHA256`.
func (o BucketObjectv2Output) ChecksumAlgorithm() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringPtrOutput { return v.ChecksumAlgorithm }).(pulumi.StringPtrOutput)
}
// The base64-encoded, 32-bit CRC32 checksum of the object.
func (o BucketObjectv2Output) ChecksumCrc32() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.ChecksumCrc32 }).(pulumi.StringOutput)
}
// The base64-encoded, 32-bit CRC32C checksum of the object.
func (o BucketObjectv2Output) ChecksumCrc32c() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.ChecksumCrc32c }).(pulumi.StringOutput)
}
// The base64-encoded, 160-bit SHA-1 digest of the object.
func (o BucketObjectv2Output) ChecksumSha1() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.ChecksumSha1 }).(pulumi.StringOutput)
}
// The base64-encoded, 256-bit SHA-256 digest of the object.
func (o BucketObjectv2Output) ChecksumSha256() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.ChecksumSha256 }).(pulumi.StringOutput)
}
// Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
func (o BucketObjectv2Output) Content() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringPtrOutput { return v.Content }).(pulumi.StringPtrOutput)
}
// 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.
func (o BucketObjectv2Output) ContentBase64() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringPtrOutput { return v.ContentBase64 }).(pulumi.StringPtrOutput)
}
// Presentational information for the object. Read [w3c contentDisposition](http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1) for further information.
func (o BucketObjectv2Output) ContentDisposition() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringPtrOutput { return v.ContentDisposition }).(pulumi.StringPtrOutput)
}
// 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.
func (o BucketObjectv2Output) ContentEncoding() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringPtrOutput { return v.ContentEncoding }).(pulumi.StringPtrOutput)
}
// Language the content is in e.g., en-US or en-GB.
func (o BucketObjectv2Output) ContentLanguage() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringPtrOutput { return v.ContentLanguage }).(pulumi.StringPtrOutput)
}
// Standard MIME type describing the format of the object data, e.g., application/octet-stream. All Valid MIME Types are valid for this input.
func (o BucketObjectv2Output) ContentType() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.ContentType }).(pulumi.StringOutput)
}
// Triggers updates when the value changes. This attribute is not compatible with KMS encryption, `kmsKeyId` or `serverSideEncryption = "aws:kms"`, also if an object is larger than 16 MB, the AWS Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest (see `sourceHash` instead).
func (o BucketObjectv2Output) Etag() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.Etag }).(pulumi.StringOutput)
}
// 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.
func (o BucketObjectv2Output) ForceDestroy() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.BoolPtrOutput { return v.ForceDestroy }).(pulumi.BoolPtrOutput)
}
// Name of the object once it is in the bucket.
//
// The following arguments are optional:
func (o BucketObjectv2Output) Key() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.Key }).(pulumi.StringOutput)
}
// 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. The provider will only perform drift detection if a configuration value is provided.
func (o BucketObjectv2Output) KmsKeyId() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.KmsKeyId }).(pulumi.StringOutput)
}
// 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).
func (o BucketObjectv2Output) Metadata() pulumi.StringMapOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringMapOutput { return v.Metadata }).(pulumi.StringMapOutput)
}
// [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`.
func (o BucketObjectv2Output) ObjectLockLegalHoldStatus() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringPtrOutput { return v.ObjectLockLegalHoldStatus }).(pulumi.StringPtrOutput)
}
// 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`.
func (o BucketObjectv2Output) ObjectLockMode() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringPtrOutput { return v.ObjectLockMode }).(pulumi.StringPtrOutput)
}
// 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).
func (o BucketObjectv2Output) ObjectLockRetainUntilDate() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringPtrOutput { return v.ObjectLockRetainUntilDate }).(pulumi.StringPtrOutput)
}
// Override provider-level configuration options. See Override Provider below for more details.
func (o BucketObjectv2Output) OverrideProvider() BucketObjectv2OverrideProviderPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) BucketObjectv2OverrideProviderPtrOutput { return v.OverrideProvider }).(BucketObjectv2OverrideProviderPtrOutput)
}
// Server-side encryption of the object in S3. Valid values are "`AES256`" and "`aws:kms`".
func (o BucketObjectv2Output) ServerSideEncryption() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.ServerSideEncryption }).(pulumi.StringOutput)
}
// Path to a file that will be read and uploaded as raw bytes for the object content.
func (o BucketObjectv2Output) Source() pulumi.AssetOrArchiveOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.AssetOrArchiveOutput { return v.Source }).(pulumi.AssetOrArchiveOutput)
}
// Triggers updates like `etag` but useful to address `etag` encryption limitations. (The value is only stored in state and not saved by AWS.)
func (o BucketObjectv2Output) SourceHash() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringPtrOutput { return v.SourceHash }).(pulumi.StringPtrOutput)
}
// [Storage Class](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#AmazonS3-PutObject-request-header-StorageClass) for the object. Defaults to "`STANDARD`".
func (o BucketObjectv2Output) StorageClass() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.StorageClass }).(pulumi.StringOutput)
}
// 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.
func (o BucketObjectv2Output) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
func (o BucketObjectv2Output) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
// Unique version ID value for the object, if bucket versioning is enabled.
func (o BucketObjectv2Output) VersionId() pulumi.StringOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringOutput { return v.VersionId }).(pulumi.StringOutput)
}
// Target URL for [website redirect](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html).
//
// If no content is provided through `source`, `content` or `contentBase64`, then the object will be empty.
//
// > **Note:** The provider ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`.
func (o BucketObjectv2Output) WebsiteRedirect() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BucketObjectv2) pulumi.StringPtrOutput { return v.WebsiteRedirect }).(pulumi.StringPtrOutput)
}
type BucketObjectv2ArrayOutput struct{ *pulumi.OutputState }
func (BucketObjectv2ArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BucketObjectv2)(nil)).Elem()
}
func (o BucketObjectv2ArrayOutput) ToBucketObjectv2ArrayOutput() BucketObjectv2ArrayOutput {
return o
}
func (o BucketObjectv2ArrayOutput) ToBucketObjectv2ArrayOutputWithContext(ctx context.Context) BucketObjectv2ArrayOutput {
return o
}
func (o BucketObjectv2ArrayOutput) Index(i pulumi.IntInput) BucketObjectv2Output {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *BucketObjectv2 {
return vs[0].([]*BucketObjectv2)[vs[1].(int)]
}).(BucketObjectv2Output)
}
type BucketObjectv2MapOutput struct{ *pulumi.OutputState }