/
getFolderSink.go
159 lines (133 loc) · 11.8 KB
/
getFolderSink.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
// 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 sink.
func LookupFolderSink(ctx *pulumi.Context, args *LookupFolderSinkArgs, opts ...pulumi.InvokeOption) (*LookupFolderSinkResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupFolderSinkResult
err := ctx.Invoke("google-native:logging/v2:getFolderSink", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupFolderSinkArgs struct {
FolderId string `pulumi:"folderId"`
SinkId string `pulumi:"sinkId"`
}
type LookupFolderSinkResult struct {
// Optional. Options that affect sinks exporting data to BigQuery.
BigqueryOptions BigQueryOptionsResponse `pulumi:"bigqueryOptions"`
// The creation timestamp of the sink.This field may not be present for older sinks.
CreateTime string `pulumi:"createTime"`
// Optional. A description of this sink.The maximum length of the description is 8000 characters.
Description string `pulumi:"description"`
// The export destination: "storage.googleapis.com/[GCS_BUCKET]" "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" "logging.googleapis.com/projects/[PROJECT_ID]" "logging.googleapis.com/projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" The sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs with Sinks (https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
Destination string `pulumi:"destination"`
// Optional. If set to true, then this sink is disabled and it does not export any log entries.
Disabled bool `pulumi:"disabled"`
// Optional. Log entries that match any of these exclusion filters will not be exported.If a log entry is matched by both filter and one of exclusion_filters it will not be exported.
Exclusions []LogExclusionResponse `pulumi:"exclusions"`
// Optional. An advanced logs filter (https://cloud.google.com/logging/docs/view/advanced-queries). The only exported log entries are those that are in the resource owning the sink and that match the filter.For example:logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
Filter string `pulumi:"filter"`
// Optional. This field applies only to sinks owned by organizations and folders. If the field is false, the default, only the logs owned by the sink's parent resource are available for export. If the field is true, then log entries from all the projects, folders, and billing accounts contained in the sink's parent resource are also available for export. Whether a particular log entry from the children is exported depends on the sink's filter expression.For example, if this field is true, then the filter resource.type=gce_instance would export all Compute Engine VM instance log entries from all projects in the sink's parent.To only export entries from certain child projects, filter on the project part of the log name:logName:("projects/test-project1/" OR "projects/test-project2/") AND resource.type=gce_instance
IncludeChildren bool `pulumi:"includeChildren"`
// The client-assigned sink identifier, unique within the project.For example: "my-syslog-errors-to-pubsub". Sink identifiers are limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. First character has to be alphanumeric.
Name string `pulumi:"name"`
// Deprecated. This field is unused.
//
// Deprecated: Deprecated. This field is unused.
OutputVersionFormat string `pulumi:"outputVersionFormat"`
// The last update timestamp of the sink.This field may not be present for older sinks.
UpdateTime string `pulumi:"updateTime"`
// An IAM identity—a service account or group—under which Cloud Logging writes the exported log entries to the sink's destination. This field is either set by specifying custom_writer_identity or set automatically by sinks.create and sinks.update based on the value of unique_writer_identity in those methods.Until you grant this identity write-access to the destination, log entry exports from this sink will fail. For more information, see Granting Access for a Resource (https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity.Sinks that have a destination that is a log bucket in the same project as the sink cannot have a writer_identity and no additional permissions are required.
WriterIdentity string `pulumi:"writerIdentity"`
}
func LookupFolderSinkOutput(ctx *pulumi.Context, args LookupFolderSinkOutputArgs, opts ...pulumi.InvokeOption) LookupFolderSinkResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupFolderSinkResult, error) {
args := v.(LookupFolderSinkArgs)
r, err := LookupFolderSink(ctx, &args, opts...)
var s LookupFolderSinkResult
if r != nil {
s = *r
}
return s, err
}).(LookupFolderSinkResultOutput)
}
type LookupFolderSinkOutputArgs struct {
FolderId pulumi.StringInput `pulumi:"folderId"`
SinkId pulumi.StringInput `pulumi:"sinkId"`
}
func (LookupFolderSinkOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupFolderSinkArgs)(nil)).Elem()
}
type LookupFolderSinkResultOutput struct{ *pulumi.OutputState }
func (LookupFolderSinkResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupFolderSinkResult)(nil)).Elem()
}
func (o LookupFolderSinkResultOutput) ToLookupFolderSinkResultOutput() LookupFolderSinkResultOutput {
return o
}
func (o LookupFolderSinkResultOutput) ToLookupFolderSinkResultOutputWithContext(ctx context.Context) LookupFolderSinkResultOutput {
return o
}
// Optional. Options that affect sinks exporting data to BigQuery.
func (o LookupFolderSinkResultOutput) BigqueryOptions() BigQueryOptionsResponseOutput {
return o.ApplyT(func(v LookupFolderSinkResult) BigQueryOptionsResponse { return v.BigqueryOptions }).(BigQueryOptionsResponseOutput)
}
// The creation timestamp of the sink.This field may not be present for older sinks.
func (o LookupFolderSinkResultOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupFolderSinkResult) string { return v.CreateTime }).(pulumi.StringOutput)
}
// Optional. A description of this sink.The maximum length of the description is 8000 characters.
func (o LookupFolderSinkResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupFolderSinkResult) string { return v.Description }).(pulumi.StringOutput)
}
// The export destination: "storage.googleapis.com/[GCS_BUCKET]" "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" "logging.googleapis.com/projects/[PROJECT_ID]" "logging.googleapis.com/projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" The sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs with Sinks (https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
func (o LookupFolderSinkResultOutput) Destination() pulumi.StringOutput {
return o.ApplyT(func(v LookupFolderSinkResult) string { return v.Destination }).(pulumi.StringOutput)
}
// Optional. If set to true, then this sink is disabled and it does not export any log entries.
func (o LookupFolderSinkResultOutput) Disabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupFolderSinkResult) bool { return v.Disabled }).(pulumi.BoolOutput)
}
// Optional. Log entries that match any of these exclusion filters will not be exported.If a log entry is matched by both filter and one of exclusion_filters it will not be exported.
func (o LookupFolderSinkResultOutput) Exclusions() LogExclusionResponseArrayOutput {
return o.ApplyT(func(v LookupFolderSinkResult) []LogExclusionResponse { return v.Exclusions }).(LogExclusionResponseArrayOutput)
}
// Optional. An advanced logs filter (https://cloud.google.com/logging/docs/view/advanced-queries). The only exported log entries are those that are in the resource owning the sink and that match the filter.For example:logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
func (o LookupFolderSinkResultOutput) Filter() pulumi.StringOutput {
return o.ApplyT(func(v LookupFolderSinkResult) string { return v.Filter }).(pulumi.StringOutput)
}
// Optional. This field applies only to sinks owned by organizations and folders. If the field is false, the default, only the logs owned by the sink's parent resource are available for export. If the field is true, then log entries from all the projects, folders, and billing accounts contained in the sink's parent resource are also available for export. Whether a particular log entry from the children is exported depends on the sink's filter expression.For example, if this field is true, then the filter resource.type=gce_instance would export all Compute Engine VM instance log entries from all projects in the sink's parent.To only export entries from certain child projects, filter on the project part of the log name:logName:("projects/test-project1/" OR "projects/test-project2/") AND resource.type=gce_instance
func (o LookupFolderSinkResultOutput) IncludeChildren() pulumi.BoolOutput {
return o.ApplyT(func(v LookupFolderSinkResult) bool { return v.IncludeChildren }).(pulumi.BoolOutput)
}
// The client-assigned sink identifier, unique within the project.For example: "my-syslog-errors-to-pubsub". Sink identifiers are limited to 100 characters and can include only the following characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods. First character has to be alphanumeric.
func (o LookupFolderSinkResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupFolderSinkResult) string { return v.Name }).(pulumi.StringOutput)
}
// Deprecated. This field is unused.
//
// Deprecated: Deprecated. This field is unused.
func (o LookupFolderSinkResultOutput) OutputVersionFormat() pulumi.StringOutput {
return o.ApplyT(func(v LookupFolderSinkResult) string { return v.OutputVersionFormat }).(pulumi.StringOutput)
}
// The last update timestamp of the sink.This field may not be present for older sinks.
func (o LookupFolderSinkResultOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupFolderSinkResult) string { return v.UpdateTime }).(pulumi.StringOutput)
}
// An IAM identity—a service account or group—under which Cloud Logging writes the exported log entries to the sink's destination. This field is either set by specifying custom_writer_identity or set automatically by sinks.create and sinks.update based on the value of unique_writer_identity in those methods.Until you grant this identity write-access to the destination, log entry exports from this sink will fail. For more information, see Granting Access for a Resource (https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity.Sinks that have a destination that is a log bucket in the same project as the sink cannot have a writer_identity and no additional permissions are required.
func (o LookupFolderSinkResultOutput) WriterIdentity() pulumi.StringOutput {
return o.ApplyT(func(v LookupFolderSinkResult) string { return v.WriterIdentity }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupFolderSinkResultOutput{})
}