generated from pulumi/pulumi-tf-provider-boilerplate
/
getBucket.go
267 lines (230 loc) · 16.3 KB
/
getBucket.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
// 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 objectstorage
import (
"context"
"reflect"
"github.com/pulumi/pulumi-oci/sdk/go/oci/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides details about a specific Bucket resource in Oracle Cloud Infrastructure Object Storage service.
//
// Gets the current representation of the given bucket in the given Object Storage namespace.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/ObjectStorage"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ObjectStorage.GetBucket(ctx, &objectstorage.GetBucketArgs{
// Name: bucketName,
// Namespace: bucketNamespace,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupBucket(ctx *pulumi.Context, args *LookupBucketArgs, opts ...pulumi.InvokeOption) (*LookupBucketResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupBucketResult
err := ctx.Invoke("oci:ObjectStorage/getBucket:getBucket", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getBucket.
type LookupBucketArgs struct {
// The name of the bucket. Avoid entering confidential information. Example: `my-new-bucket1`
Name string `pulumi:"name"`
// The Object Storage namespace used for the request.
Namespace string `pulumi:"namespace"`
}
// A collection of values returned by getBucket.
type LookupBucketResult struct {
// The type of public access enabled on this bucket. A bucket is set to `NoPublicAccess` by default, which only allows an authenticated caller to access the bucket and its contents. When `ObjectRead` is enabled on the bucket, public access is allowed for the `GetObject`, `HeadObject`, and `ListObjects` operations. When `ObjectReadWithoutList` is enabled on the bucket, public access is allowed for the `GetObject` and `HeadObject` operations.
AccessType string `pulumi:"accessType"`
// The approximate number of objects in the bucket. Count statistics are reported periodically. You will see a lag between what is displayed and the actual object count.
ApproximateCount string `pulumi:"approximateCount"`
// The approximate total size in bytes of all objects in the bucket. Size statistics are reported periodically. You will see a lag between what is displayed and the actual size of the bucket.
ApproximateSize string `pulumi:"approximateSize"`
// The auto tiering status on the bucket. A bucket is created with auto tiering `Disabled` by default. For auto tiering `InfrequentAccess`, objects are transitioned automatically between the 'Standard' and 'InfrequentAccess' tiers based on the access pattern of the objects.
AutoTiering string `pulumi:"autoTiering"`
// The OCID of the bucket which is a Oracle assigned unique identifier for this resource type (bucket). `bucketId` cannot be used for bucket lookup.
BucketId string `pulumi:"bucketId"`
// The compartment ID in which the bucket is authorized.
CompartmentId string `pulumi:"compartmentId"`
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the bucket.
CreatedBy string `pulumi:"createdBy"`
// Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}`
DefinedTags map[string]interface{} `pulumi:"definedTags"`
// The entity tag (ETag) for the bucket.
Etag string `pulumi:"etag"`
// Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
FreeformTags map[string]interface{} `pulumi:"freeformTags"`
Id string `pulumi:"id"`
// Whether or not this bucket is read only. By default, `isReadOnly` is set to `false`. This will be set to 'true' when this bucket is configured as a destination in a replication policy.
IsReadOnly bool `pulumi:"isReadOnly"`
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key.
KmsKeyId string `pulumi:"kmsKeyId"`
// Arbitrary string keys and values for user-defined metadata.
Metadata map[string]interface{} `pulumi:"metadata"`
// The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
Name string `pulumi:"name"`
// The Object Storage namespace in which the bucket resides.
Namespace string `pulumi:"namespace"`
// Whether or not events are emitted for object state changes in this bucket. By default, `objectEventsEnabled` is set to `false`. Set `objectEventsEnabled` to `true` to emit events for object state changes. For more information about events, see [Overview of Events](https://docs.cloud.oracle.com/iaas/Content/Events/Concepts/eventsoverview.htm).
ObjectEventsEnabled bool `pulumi:"objectEventsEnabled"`
// The entity tag (ETag) for the live object lifecycle policy on the bucket.
ObjectLifecyclePolicyEtag string `pulumi:"objectLifecyclePolicyEtag"`
// Whether or not this bucket is a replication source. By default, `replicationEnabled` is set to `false`. This will be set to 'true' when you create a replication policy for the bucket.
ReplicationEnabled bool `pulumi:"replicationEnabled"`
// User specified list of retention rules for the bucket.
RetentionRules []GetBucketRetentionRule `pulumi:"retentionRules"`
// The storage tier type assigned to the bucket. A bucket is set to `Standard` tier by default, which means objects uploaded or copied to the bucket will be in the standard storage tier. When the `Archive` tier type is set explicitly for a bucket, objects uploaded or copied to the bucket will be stored in archive storage. The `storageTier` property is immutable after bucket is created.
StorageTier string `pulumi:"storageTier"`
// The date and time the bucket was created, as described in [RFC 2616](https://tools.ietf.org/html/rfc2616#section-14.29).
TimeCreated string `pulumi:"timeCreated"`
// The versioning status on the bucket. A bucket is created with versioning `Disabled` by default. For versioning `Enabled`, objects are protected from overwrites and deletes, by maintaining their version history. When versioning is `Suspended`, the previous versions will still remain but new versions will no longer be created when overwitten or deleted.
Versioning string `pulumi:"versioning"`
}
func LookupBucketOutput(ctx *pulumi.Context, args LookupBucketOutputArgs, opts ...pulumi.InvokeOption) LookupBucketResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupBucketResult, error) {
args := v.(LookupBucketArgs)
r, err := LookupBucket(ctx, &args, opts...)
var s LookupBucketResult
if r != nil {
s = *r
}
return s, err
}).(LookupBucketResultOutput)
}
// A collection of arguments for invoking getBucket.
type LookupBucketOutputArgs struct {
// The name of the bucket. Avoid entering confidential information. Example: `my-new-bucket1`
Name pulumi.StringInput `pulumi:"name"`
// The Object Storage namespace used for the request.
Namespace pulumi.StringInput `pulumi:"namespace"`
}
func (LookupBucketOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupBucketArgs)(nil)).Elem()
}
// A collection of values returned by getBucket.
type LookupBucketResultOutput struct{ *pulumi.OutputState }
func (LookupBucketResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupBucketResult)(nil)).Elem()
}
func (o LookupBucketResultOutput) ToLookupBucketResultOutput() LookupBucketResultOutput {
return o
}
func (o LookupBucketResultOutput) ToLookupBucketResultOutputWithContext(ctx context.Context) LookupBucketResultOutput {
return o
}
// The type of public access enabled on this bucket. A bucket is set to `NoPublicAccess` by default, which only allows an authenticated caller to access the bucket and its contents. When `ObjectRead` is enabled on the bucket, public access is allowed for the `GetObject`, `HeadObject`, and `ListObjects` operations. When `ObjectReadWithoutList` is enabled on the bucket, public access is allowed for the `GetObject` and `HeadObject` operations.
func (o LookupBucketResultOutput) AccessType() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.AccessType }).(pulumi.StringOutput)
}
// The approximate number of objects in the bucket. Count statistics are reported periodically. You will see a lag between what is displayed and the actual object count.
func (o LookupBucketResultOutput) ApproximateCount() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.ApproximateCount }).(pulumi.StringOutput)
}
// The approximate total size in bytes of all objects in the bucket. Size statistics are reported periodically. You will see a lag between what is displayed and the actual size of the bucket.
func (o LookupBucketResultOutput) ApproximateSize() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.ApproximateSize }).(pulumi.StringOutput)
}
// The auto tiering status on the bucket. A bucket is created with auto tiering `Disabled` by default. For auto tiering `InfrequentAccess`, objects are transitioned automatically between the 'Standard' and 'InfrequentAccess' tiers based on the access pattern of the objects.
func (o LookupBucketResultOutput) AutoTiering() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.AutoTiering }).(pulumi.StringOutput)
}
// The OCID of the bucket which is a Oracle assigned unique identifier for this resource type (bucket). `bucketId` cannot be used for bucket lookup.
func (o LookupBucketResultOutput) BucketId() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.BucketId }).(pulumi.StringOutput)
}
// The compartment ID in which the bucket is authorized.
func (o LookupBucketResultOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.CompartmentId }).(pulumi.StringOutput)
}
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the bucket.
func (o LookupBucketResultOutput) CreatedBy() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.CreatedBy }).(pulumi.StringOutput)
}
// Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}`
func (o LookupBucketResultOutput) DefinedTags() pulumi.MapOutput {
return o.ApplyT(func(v LookupBucketResult) map[string]interface{} { return v.DefinedTags }).(pulumi.MapOutput)
}
// The entity tag (ETag) for the bucket.
func (o LookupBucketResultOutput) Etag() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.Etag }).(pulumi.StringOutput)
}
// Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
func (o LookupBucketResultOutput) FreeformTags() pulumi.MapOutput {
return o.ApplyT(func(v LookupBucketResult) map[string]interface{} { return v.FreeformTags }).(pulumi.MapOutput)
}
func (o LookupBucketResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.Id }).(pulumi.StringOutput)
}
// Whether or not this bucket is read only. By default, `isReadOnly` is set to `false`. This will be set to 'true' when this bucket is configured as a destination in a replication policy.
func (o LookupBucketResultOutput) IsReadOnly() pulumi.BoolOutput {
return o.ApplyT(func(v LookupBucketResult) bool { return v.IsReadOnly }).(pulumi.BoolOutput)
}
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key.
func (o LookupBucketResultOutput) KmsKeyId() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.KmsKeyId }).(pulumi.StringOutput)
}
// Arbitrary string keys and values for user-defined metadata.
func (o LookupBucketResultOutput) Metadata() pulumi.MapOutput {
return o.ApplyT(func(v LookupBucketResult) map[string]interface{} { return v.Metadata }).(pulumi.MapOutput)
}
// The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1
func (o LookupBucketResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.Name }).(pulumi.StringOutput)
}
// The Object Storage namespace in which the bucket resides.
func (o LookupBucketResultOutput) Namespace() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.Namespace }).(pulumi.StringOutput)
}
// Whether or not events are emitted for object state changes in this bucket. By default, `objectEventsEnabled` is set to `false`. Set `objectEventsEnabled` to `true` to emit events for object state changes. For more information about events, see [Overview of Events](https://docs.cloud.oracle.com/iaas/Content/Events/Concepts/eventsoverview.htm).
func (o LookupBucketResultOutput) ObjectEventsEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupBucketResult) bool { return v.ObjectEventsEnabled }).(pulumi.BoolOutput)
}
// The entity tag (ETag) for the live object lifecycle policy on the bucket.
func (o LookupBucketResultOutput) ObjectLifecyclePolicyEtag() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.ObjectLifecyclePolicyEtag }).(pulumi.StringOutput)
}
// Whether or not this bucket is a replication source. By default, `replicationEnabled` is set to `false`. This will be set to 'true' when you create a replication policy for the bucket.
func (o LookupBucketResultOutput) ReplicationEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupBucketResult) bool { return v.ReplicationEnabled }).(pulumi.BoolOutput)
}
// User specified list of retention rules for the bucket.
func (o LookupBucketResultOutput) RetentionRules() GetBucketRetentionRuleArrayOutput {
return o.ApplyT(func(v LookupBucketResult) []GetBucketRetentionRule { return v.RetentionRules }).(GetBucketRetentionRuleArrayOutput)
}
// The storage tier type assigned to the bucket. A bucket is set to `Standard` tier by default, which means objects uploaded or copied to the bucket will be in the standard storage tier. When the `Archive` tier type is set explicitly for a bucket, objects uploaded or copied to the bucket will be stored in archive storage. The `storageTier` property is immutable after bucket is created.
func (o LookupBucketResultOutput) StorageTier() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.StorageTier }).(pulumi.StringOutput)
}
// The date and time the bucket was created, as described in [RFC 2616](https://tools.ietf.org/html/rfc2616#section-14.29).
func (o LookupBucketResultOutput) TimeCreated() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.TimeCreated }).(pulumi.StringOutput)
}
// The versioning status on the bucket. A bucket is created with versioning `Disabled` by default. For versioning `Enabled`, objects are protected from overwrites and deletes, by maintaining their version history. When versioning is `Suspended`, the previous versions will still remain but new versions will no longer be created when overwitten or deleted.
func (o LookupBucketResultOutput) Versioning() pulumi.StringOutput {
return o.ApplyT(func(v LookupBucketResult) string { return v.Versioning }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupBucketResultOutput{})
}