/
billingAccountExclusion.go
339 lines (288 loc) · 13.7 KB
/
billingAccountExclusion.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
// 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 logging
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/logging"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := logging.NewBillingAccountExclusion(ctx, "my-exclusion", &logging.BillingAccountExclusionArgs{
// Name: pulumi.String("my-instance-debug-exclusion"),
// BillingAccount: pulumi.String("ABCDEF-012345-GHIJKL"),
// Description: pulumi.String("Exclude GCE instance debug logs"),
// Filter: pulumi.String("resource.type = gce_instance AND severity <= DEBUG"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Billing account logging exclusions can be imported using their URI, e.g.
//
// * `billingAccounts/{{billing_account}}/exclusions/{{name}}`
//
// When using the `pulumi import` command, billing account logging exclusions can be imported using one of the formats above. For example:
//
// ```sh
// $ pulumi import gcp:logging/billingAccountExclusion:BillingAccountExclusion default billingAccounts/{{billing_account}}/exclusions/{{name}}
// ```
type BillingAccountExclusion struct {
pulumi.CustomResourceState
// The billing account to create the exclusion for.
BillingAccount pulumi.StringOutput `pulumi:"billingAccount"`
// A human-readable description.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Whether this exclusion rule should be disabled or not. This defaults to
// false.
Disabled pulumi.BoolPtrOutput `pulumi:"disabled"`
// The filter to apply when excluding logs. Only log entries that match the filter are excluded.
// See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced-filters) for information on how to
// write a filter.
Filter pulumi.StringOutput `pulumi:"filter"`
// The name of the logging exclusion.
Name pulumi.StringOutput `pulumi:"name"`
}
// NewBillingAccountExclusion registers a new resource with the given unique name, arguments, and options.
func NewBillingAccountExclusion(ctx *pulumi.Context,
name string, args *BillingAccountExclusionArgs, opts ...pulumi.ResourceOption) (*BillingAccountExclusion, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.BillingAccount == nil {
return nil, errors.New("invalid value for required argument 'BillingAccount'")
}
if args.Filter == nil {
return nil, errors.New("invalid value for required argument 'Filter'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource BillingAccountExclusion
err := ctx.RegisterResource("gcp:logging/billingAccountExclusion:BillingAccountExclusion", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetBillingAccountExclusion gets an existing BillingAccountExclusion 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 GetBillingAccountExclusion(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *BillingAccountExclusionState, opts ...pulumi.ResourceOption) (*BillingAccountExclusion, error) {
var resource BillingAccountExclusion
err := ctx.ReadResource("gcp:logging/billingAccountExclusion:BillingAccountExclusion", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering BillingAccountExclusion resources.
type billingAccountExclusionState struct {
// The billing account to create the exclusion for.
BillingAccount *string `pulumi:"billingAccount"`
// A human-readable description.
Description *string `pulumi:"description"`
// Whether this exclusion rule should be disabled or not. This defaults to
// false.
Disabled *bool `pulumi:"disabled"`
// The filter to apply when excluding logs. Only log entries that match the filter are excluded.
// See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced-filters) for information on how to
// write a filter.
Filter *string `pulumi:"filter"`
// The name of the logging exclusion.
Name *string `pulumi:"name"`
}
type BillingAccountExclusionState struct {
// The billing account to create the exclusion for.
BillingAccount pulumi.StringPtrInput
// A human-readable description.
Description pulumi.StringPtrInput
// Whether this exclusion rule should be disabled or not. This defaults to
// false.
Disabled pulumi.BoolPtrInput
// The filter to apply when excluding logs. Only log entries that match the filter are excluded.
// See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced-filters) for information on how to
// write a filter.
Filter pulumi.StringPtrInput
// The name of the logging exclusion.
Name pulumi.StringPtrInput
}
func (BillingAccountExclusionState) ElementType() reflect.Type {
return reflect.TypeOf((*billingAccountExclusionState)(nil)).Elem()
}
type billingAccountExclusionArgs struct {
// The billing account to create the exclusion for.
BillingAccount string `pulumi:"billingAccount"`
// A human-readable description.
Description *string `pulumi:"description"`
// Whether this exclusion rule should be disabled or not. This defaults to
// false.
Disabled *bool `pulumi:"disabled"`
// The filter to apply when excluding logs. Only log entries that match the filter are excluded.
// See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced-filters) for information on how to
// write a filter.
Filter string `pulumi:"filter"`
// The name of the logging exclusion.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a BillingAccountExclusion resource.
type BillingAccountExclusionArgs struct {
// The billing account to create the exclusion for.
BillingAccount pulumi.StringInput
// A human-readable description.
Description pulumi.StringPtrInput
// Whether this exclusion rule should be disabled or not. This defaults to
// false.
Disabled pulumi.BoolPtrInput
// The filter to apply when excluding logs. Only log entries that match the filter are excluded.
// See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced-filters) for information on how to
// write a filter.
Filter pulumi.StringInput
// The name of the logging exclusion.
Name pulumi.StringPtrInput
}
func (BillingAccountExclusionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*billingAccountExclusionArgs)(nil)).Elem()
}
type BillingAccountExclusionInput interface {
pulumi.Input
ToBillingAccountExclusionOutput() BillingAccountExclusionOutput
ToBillingAccountExclusionOutputWithContext(ctx context.Context) BillingAccountExclusionOutput
}
func (*BillingAccountExclusion) ElementType() reflect.Type {
return reflect.TypeOf((**BillingAccountExclusion)(nil)).Elem()
}
func (i *BillingAccountExclusion) ToBillingAccountExclusionOutput() BillingAccountExclusionOutput {
return i.ToBillingAccountExclusionOutputWithContext(context.Background())
}
func (i *BillingAccountExclusion) ToBillingAccountExclusionOutputWithContext(ctx context.Context) BillingAccountExclusionOutput {
return pulumi.ToOutputWithContext(ctx, i).(BillingAccountExclusionOutput)
}
// BillingAccountExclusionArrayInput is an input type that accepts BillingAccountExclusionArray and BillingAccountExclusionArrayOutput values.
// You can construct a concrete instance of `BillingAccountExclusionArrayInput` via:
//
// BillingAccountExclusionArray{ BillingAccountExclusionArgs{...} }
type BillingAccountExclusionArrayInput interface {
pulumi.Input
ToBillingAccountExclusionArrayOutput() BillingAccountExclusionArrayOutput
ToBillingAccountExclusionArrayOutputWithContext(context.Context) BillingAccountExclusionArrayOutput
}
type BillingAccountExclusionArray []BillingAccountExclusionInput
func (BillingAccountExclusionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BillingAccountExclusion)(nil)).Elem()
}
func (i BillingAccountExclusionArray) ToBillingAccountExclusionArrayOutput() BillingAccountExclusionArrayOutput {
return i.ToBillingAccountExclusionArrayOutputWithContext(context.Background())
}
func (i BillingAccountExclusionArray) ToBillingAccountExclusionArrayOutputWithContext(ctx context.Context) BillingAccountExclusionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(BillingAccountExclusionArrayOutput)
}
// BillingAccountExclusionMapInput is an input type that accepts BillingAccountExclusionMap and BillingAccountExclusionMapOutput values.
// You can construct a concrete instance of `BillingAccountExclusionMapInput` via:
//
// BillingAccountExclusionMap{ "key": BillingAccountExclusionArgs{...} }
type BillingAccountExclusionMapInput interface {
pulumi.Input
ToBillingAccountExclusionMapOutput() BillingAccountExclusionMapOutput
ToBillingAccountExclusionMapOutputWithContext(context.Context) BillingAccountExclusionMapOutput
}
type BillingAccountExclusionMap map[string]BillingAccountExclusionInput
func (BillingAccountExclusionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BillingAccountExclusion)(nil)).Elem()
}
func (i BillingAccountExclusionMap) ToBillingAccountExclusionMapOutput() BillingAccountExclusionMapOutput {
return i.ToBillingAccountExclusionMapOutputWithContext(context.Background())
}
func (i BillingAccountExclusionMap) ToBillingAccountExclusionMapOutputWithContext(ctx context.Context) BillingAccountExclusionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(BillingAccountExclusionMapOutput)
}
type BillingAccountExclusionOutput struct{ *pulumi.OutputState }
func (BillingAccountExclusionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**BillingAccountExclusion)(nil)).Elem()
}
func (o BillingAccountExclusionOutput) ToBillingAccountExclusionOutput() BillingAccountExclusionOutput {
return o
}
func (o BillingAccountExclusionOutput) ToBillingAccountExclusionOutputWithContext(ctx context.Context) BillingAccountExclusionOutput {
return o
}
// The billing account to create the exclusion for.
func (o BillingAccountExclusionOutput) BillingAccount() pulumi.StringOutput {
return o.ApplyT(func(v *BillingAccountExclusion) pulumi.StringOutput { return v.BillingAccount }).(pulumi.StringOutput)
}
// A human-readable description.
func (o BillingAccountExclusionOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *BillingAccountExclusion) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Whether this exclusion rule should be disabled or not. This defaults to
// false.
func (o BillingAccountExclusionOutput) Disabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *BillingAccountExclusion) pulumi.BoolPtrOutput { return v.Disabled }).(pulumi.BoolPtrOutput)
}
// The filter to apply when excluding logs. Only log entries that match the filter are excluded.
// See [Advanced Log Filters](https://cloud.google.com/logging/docs/view/advanced-filters) for information on how to
// write a filter.
func (o BillingAccountExclusionOutput) Filter() pulumi.StringOutput {
return o.ApplyT(func(v *BillingAccountExclusion) pulumi.StringOutput { return v.Filter }).(pulumi.StringOutput)
}
// The name of the logging exclusion.
func (o BillingAccountExclusionOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *BillingAccountExclusion) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
type BillingAccountExclusionArrayOutput struct{ *pulumi.OutputState }
func (BillingAccountExclusionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*BillingAccountExclusion)(nil)).Elem()
}
func (o BillingAccountExclusionArrayOutput) ToBillingAccountExclusionArrayOutput() BillingAccountExclusionArrayOutput {
return o
}
func (o BillingAccountExclusionArrayOutput) ToBillingAccountExclusionArrayOutputWithContext(ctx context.Context) BillingAccountExclusionArrayOutput {
return o
}
func (o BillingAccountExclusionArrayOutput) Index(i pulumi.IntInput) BillingAccountExclusionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *BillingAccountExclusion {
return vs[0].([]*BillingAccountExclusion)[vs[1].(int)]
}).(BillingAccountExclusionOutput)
}
type BillingAccountExclusionMapOutput struct{ *pulumi.OutputState }
func (BillingAccountExclusionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*BillingAccountExclusion)(nil)).Elem()
}
func (o BillingAccountExclusionMapOutput) ToBillingAccountExclusionMapOutput() BillingAccountExclusionMapOutput {
return o
}
func (o BillingAccountExclusionMapOutput) ToBillingAccountExclusionMapOutputWithContext(ctx context.Context) BillingAccountExclusionMapOutput {
return o
}
func (o BillingAccountExclusionMapOutput) MapIndex(k pulumi.StringInput) BillingAccountExclusionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *BillingAccountExclusion {
return vs[0].(map[string]*BillingAccountExclusion)[vs[1].(string)]
}).(BillingAccountExclusionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*BillingAccountExclusionInput)(nil)).Elem(), &BillingAccountExclusion{})
pulumi.RegisterInputType(reflect.TypeOf((*BillingAccountExclusionArrayInput)(nil)).Elem(), BillingAccountExclusionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*BillingAccountExclusionMapInput)(nil)).Elem(), BillingAccountExclusionMap{})
pulumi.RegisterOutputType(BillingAccountExclusionOutput{})
pulumi.RegisterOutputType(BillingAccountExclusionArrayOutput{})
pulumi.RegisterOutputType(BillingAccountExclusionMapOutput{})
}