/
getOrganizationBucket.go
150 lines (125 loc) · 8.47 KB
/
getOrganizationBucket.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v2
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets a log bucket.
func LookupOrganizationBucket(ctx *pulumi.Context, args *LookupOrganizationBucketArgs, opts ...pulumi.InvokeOption) (*LookupOrganizationBucketResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupOrganizationBucketResult
err := ctx.Invoke("google-native:logging/v2:getOrganizationBucket", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupOrganizationBucketArgs struct {
BucketId string `pulumi:"bucketId"`
Location string `pulumi:"location"`
OrganizationId string `pulumi:"organizationId"`
}
type LookupOrganizationBucketResult struct {
// Whether log analytics is enabled for this bucket.Once enabled, log analytics features cannot be disabled.
AnalyticsEnabled bool `pulumi:"analyticsEnabled"`
// The CMEK settings of the log bucket. If present, new log entries written to this log bucket are encrypted using the CMEK key provided in this configuration. If a log bucket has CMEK settings, the CMEK settings cannot be disabled later by updating the log bucket. Changing the KMS key is allowed.
CmekSettings CmekSettingsResponse `pulumi:"cmekSettings"`
// The creation timestamp of the bucket. This is not set for any of the default buckets.
CreateTime string `pulumi:"createTime"`
// Describes this bucket.
Description string `pulumi:"description"`
// A list of indexed fields and related configuration data.
IndexConfigs []IndexConfigResponse `pulumi:"indexConfigs"`
// The bucket lifecycle state.
LifecycleState string `pulumi:"lifecycleState"`
// Whether the bucket is locked.The retention period on a locked bucket cannot be changed. Locked buckets may only be deleted if they are empty.
Locked bool `pulumi:"locked"`
// The resource name of the bucket.For example:projects/my-project/locations/global/buckets/my-bucketFor a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support)For the location of global it is unspecified where log entries are actually stored.After a bucket has been created, the location cannot be changed.
Name string `pulumi:"name"`
// Log entry field paths that are denied access in this bucket.The following fields and their children are eligible: textPayload, jsonPayload, protoPayload, httpRequest, labels, sourceLocation.Restricting a repeated field will restrict all values. Adding a parent will block all child fields. (e.g. foo.bar will block foo.bar.baz)
RestrictedFields []string `pulumi:"restrictedFields"`
// Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
RetentionDays int `pulumi:"retentionDays"`
// The last update timestamp of the bucket.
UpdateTime string `pulumi:"updateTime"`
}
func LookupOrganizationBucketOutput(ctx *pulumi.Context, args LookupOrganizationBucketOutputArgs, opts ...pulumi.InvokeOption) LookupOrganizationBucketResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupOrganizationBucketResult, error) {
args := v.(LookupOrganizationBucketArgs)
r, err := LookupOrganizationBucket(ctx, &args, opts...)
var s LookupOrganizationBucketResult
if r != nil {
s = *r
}
return s, err
}).(LookupOrganizationBucketResultOutput)
}
type LookupOrganizationBucketOutputArgs struct {
BucketId pulumi.StringInput `pulumi:"bucketId"`
Location pulumi.StringInput `pulumi:"location"`
OrganizationId pulumi.StringInput `pulumi:"organizationId"`
}
func (LookupOrganizationBucketOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupOrganizationBucketArgs)(nil)).Elem()
}
type LookupOrganizationBucketResultOutput struct{ *pulumi.OutputState }
func (LookupOrganizationBucketResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupOrganizationBucketResult)(nil)).Elem()
}
func (o LookupOrganizationBucketResultOutput) ToLookupOrganizationBucketResultOutput() LookupOrganizationBucketResultOutput {
return o
}
func (o LookupOrganizationBucketResultOutput) ToLookupOrganizationBucketResultOutputWithContext(ctx context.Context) LookupOrganizationBucketResultOutput {
return o
}
// Whether log analytics is enabled for this bucket.Once enabled, log analytics features cannot be disabled.
func (o LookupOrganizationBucketResultOutput) AnalyticsEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupOrganizationBucketResult) bool { return v.AnalyticsEnabled }).(pulumi.BoolOutput)
}
// The CMEK settings of the log bucket. If present, new log entries written to this log bucket are encrypted using the CMEK key provided in this configuration. If a log bucket has CMEK settings, the CMEK settings cannot be disabled later by updating the log bucket. Changing the KMS key is allowed.
func (o LookupOrganizationBucketResultOutput) CmekSettings() CmekSettingsResponseOutput {
return o.ApplyT(func(v LookupOrganizationBucketResult) CmekSettingsResponse { return v.CmekSettings }).(CmekSettingsResponseOutput)
}
// The creation timestamp of the bucket. This is not set for any of the default buckets.
func (o LookupOrganizationBucketResultOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupOrganizationBucketResult) string { return v.CreateTime }).(pulumi.StringOutput)
}
// Describes this bucket.
func (o LookupOrganizationBucketResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupOrganizationBucketResult) string { return v.Description }).(pulumi.StringOutput)
}
// A list of indexed fields and related configuration data.
func (o LookupOrganizationBucketResultOutput) IndexConfigs() IndexConfigResponseArrayOutput {
return o.ApplyT(func(v LookupOrganizationBucketResult) []IndexConfigResponse { return v.IndexConfigs }).(IndexConfigResponseArrayOutput)
}
// The bucket lifecycle state.
func (o LookupOrganizationBucketResultOutput) LifecycleState() pulumi.StringOutput {
return o.ApplyT(func(v LookupOrganizationBucketResult) string { return v.LifecycleState }).(pulumi.StringOutput)
}
// Whether the bucket is locked.The retention period on a locked bucket cannot be changed. Locked buckets may only be deleted if they are empty.
func (o LookupOrganizationBucketResultOutput) Locked() pulumi.BoolOutput {
return o.ApplyT(func(v LookupOrganizationBucketResult) bool { return v.Locked }).(pulumi.BoolOutput)
}
// The resource name of the bucket.For example:projects/my-project/locations/global/buckets/my-bucketFor a list of supported locations, see Supported Regions (https://cloud.google.com/logging/docs/region-support)For the location of global it is unspecified where log entries are actually stored.After a bucket has been created, the location cannot be changed.
func (o LookupOrganizationBucketResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupOrganizationBucketResult) string { return v.Name }).(pulumi.StringOutput)
}
// Log entry field paths that are denied access in this bucket.The following fields and their children are eligible: textPayload, jsonPayload, protoPayload, httpRequest, labels, sourceLocation.Restricting a repeated field will restrict all values. Adding a parent will block all child fields. (e.g. foo.bar will block foo.bar.baz)
func (o LookupOrganizationBucketResultOutput) RestrictedFields() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupOrganizationBucketResult) []string { return v.RestrictedFields }).(pulumi.StringArrayOutput)
}
// Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.
func (o LookupOrganizationBucketResultOutput) RetentionDays() pulumi.IntOutput {
return o.ApplyT(func(v LookupOrganizationBucketResult) int { return v.RetentionDays }).(pulumi.IntOutput)
}
// The last update timestamp of the bucket.
func (o LookupOrganizationBucketResultOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupOrganizationBucketResult) string { return v.UpdateTime }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupOrganizationBucketResultOutput{})
}