generated from pulumi/pulumi-tf-provider-boilerplate
/
consumerGroupModifyOffset.go
389 lines (335 loc) · 21.2 KB
/
consumerGroupModifyOffset.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
// 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 ckafka
import (
"context"
"reflect"
"errors"
"github.com/mergtil/pulumi-tencentcloud/sdk/go/tencentcloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type ConsumerGroupModifyOffset struct {
pulumi.CustomResourceState
// kafka group.
Group pulumi.StringOutput `pulumi:"group"`
// Kafka instance id.
InstanceId pulumi.StringOutput `pulumi:"instanceId"`
// The offset location that needs to be reset. When strategy is 2, this field must be included.
Offset pulumi.IntPtrOutput `pulumi:"offset"`
// The list of partition that needs to be reset if no Topics parameter is specified. Resets the partition in the
// corresponding Partition list of all topics. When Topics is specified, the partition of the corresponding topic list of
// the specified Partitions list is reset.
Partitions pulumi.IntArrayOutput `pulumi:"partitions"`
// This field must be included when strategy is 0. If it is greater than zero, the offset will be moved backward by shift
// bars, and if it is less than zero, the offset will be traced back to the number of shift entries. After the correct
// reset, the new offset should be (old_offset + shift). It should be noted that if the new offset is less than partition's
// earliest, it will be set to earliest, and if the latest greater than partition will be set to latest.
Shift pulumi.IntPtrOutput `pulumi:"shift"`
// Unit ms. When strategy is 1, you must include this field, where-2 means to reset the offset to the beginning,-1 means to
// reset to the latest position (equivalent to emptying), and other values represent the specified time. You will get the
// offset of the specified time in the topic and then reset it. If there is no message at the specified time, get the last
// offset.
ShiftTimestamp pulumi.IntPtrOutput `pulumi:"shiftTimestamp"`
// Reset the policy of offset. `0`: Move the offset forward or backward shift bar; `1`: Alignment reference
// (by-duration,to-datetime,to-earliest,to-latest), which means moving the offset to the location of the specified
// timestamp; `2`: Alignment reference (to-offset), which means to move the offset to the specified offset location.
Strategy pulumi.IntOutput `pulumi:"strategy"`
// Indicates the topics that needs to be reset. Leave it empty means all.
Topics pulumi.StringArrayOutput `pulumi:"topics"`
}
// NewConsumerGroupModifyOffset registers a new resource with the given unique name, arguments, and options.
func NewConsumerGroupModifyOffset(ctx *pulumi.Context,
name string, args *ConsumerGroupModifyOffsetArgs, opts ...pulumi.ResourceOption) (*ConsumerGroupModifyOffset, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Group == nil {
return nil, errors.New("invalid value for required argument 'Group'")
}
if args.InstanceId == nil {
return nil, errors.New("invalid value for required argument 'InstanceId'")
}
if args.Strategy == nil {
return nil, errors.New("invalid value for required argument 'Strategy'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource ConsumerGroupModifyOffset
err := ctx.RegisterResource("tencentcloud:Ckafka/consumerGroupModifyOffset:ConsumerGroupModifyOffset", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetConsumerGroupModifyOffset gets an existing ConsumerGroupModifyOffset 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 GetConsumerGroupModifyOffset(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ConsumerGroupModifyOffsetState, opts ...pulumi.ResourceOption) (*ConsumerGroupModifyOffset, error) {
var resource ConsumerGroupModifyOffset
err := ctx.ReadResource("tencentcloud:Ckafka/consumerGroupModifyOffset:ConsumerGroupModifyOffset", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering ConsumerGroupModifyOffset resources.
type consumerGroupModifyOffsetState struct {
// kafka group.
Group *string `pulumi:"group"`
// Kafka instance id.
InstanceId *string `pulumi:"instanceId"`
// The offset location that needs to be reset. When strategy is 2, this field must be included.
Offset *int `pulumi:"offset"`
// The list of partition that needs to be reset if no Topics parameter is specified. Resets the partition in the
// corresponding Partition list of all topics. When Topics is specified, the partition of the corresponding topic list of
// the specified Partitions list is reset.
Partitions []int `pulumi:"partitions"`
// This field must be included when strategy is 0. If it is greater than zero, the offset will be moved backward by shift
// bars, and if it is less than zero, the offset will be traced back to the number of shift entries. After the correct
// reset, the new offset should be (old_offset + shift). It should be noted that if the new offset is less than partition's
// earliest, it will be set to earliest, and if the latest greater than partition will be set to latest.
Shift *int `pulumi:"shift"`
// Unit ms. When strategy is 1, you must include this field, where-2 means to reset the offset to the beginning,-1 means to
// reset to the latest position (equivalent to emptying), and other values represent the specified time. You will get the
// offset of the specified time in the topic and then reset it. If there is no message at the specified time, get the last
// offset.
ShiftTimestamp *int `pulumi:"shiftTimestamp"`
// Reset the policy of offset. `0`: Move the offset forward or backward shift bar; `1`: Alignment reference
// (by-duration,to-datetime,to-earliest,to-latest), which means moving the offset to the location of the specified
// timestamp; `2`: Alignment reference (to-offset), which means to move the offset to the specified offset location.
Strategy *int `pulumi:"strategy"`
// Indicates the topics that needs to be reset. Leave it empty means all.
Topics []string `pulumi:"topics"`
}
type ConsumerGroupModifyOffsetState struct {
// kafka group.
Group pulumi.StringPtrInput
// Kafka instance id.
InstanceId pulumi.StringPtrInput
// The offset location that needs to be reset. When strategy is 2, this field must be included.
Offset pulumi.IntPtrInput
// The list of partition that needs to be reset if no Topics parameter is specified. Resets the partition in the
// corresponding Partition list of all topics. When Topics is specified, the partition of the corresponding topic list of
// the specified Partitions list is reset.
Partitions pulumi.IntArrayInput
// This field must be included when strategy is 0. If it is greater than zero, the offset will be moved backward by shift
// bars, and if it is less than zero, the offset will be traced back to the number of shift entries. After the correct
// reset, the new offset should be (old_offset + shift). It should be noted that if the new offset is less than partition's
// earliest, it will be set to earliest, and if the latest greater than partition will be set to latest.
Shift pulumi.IntPtrInput
// Unit ms. When strategy is 1, you must include this field, where-2 means to reset the offset to the beginning,-1 means to
// reset to the latest position (equivalent to emptying), and other values represent the specified time. You will get the
// offset of the specified time in the topic and then reset it. If there is no message at the specified time, get the last
// offset.
ShiftTimestamp pulumi.IntPtrInput
// Reset the policy of offset. `0`: Move the offset forward or backward shift bar; `1`: Alignment reference
// (by-duration,to-datetime,to-earliest,to-latest), which means moving the offset to the location of the specified
// timestamp; `2`: Alignment reference (to-offset), which means to move the offset to the specified offset location.
Strategy pulumi.IntPtrInput
// Indicates the topics that needs to be reset. Leave it empty means all.
Topics pulumi.StringArrayInput
}
func (ConsumerGroupModifyOffsetState) ElementType() reflect.Type {
return reflect.TypeOf((*consumerGroupModifyOffsetState)(nil)).Elem()
}
type consumerGroupModifyOffsetArgs struct {
// kafka group.
Group string `pulumi:"group"`
// Kafka instance id.
InstanceId string `pulumi:"instanceId"`
// The offset location that needs to be reset. When strategy is 2, this field must be included.
Offset *int `pulumi:"offset"`
// The list of partition that needs to be reset if no Topics parameter is specified. Resets the partition in the
// corresponding Partition list of all topics. When Topics is specified, the partition of the corresponding topic list of
// the specified Partitions list is reset.
Partitions []int `pulumi:"partitions"`
// This field must be included when strategy is 0. If it is greater than zero, the offset will be moved backward by shift
// bars, and if it is less than zero, the offset will be traced back to the number of shift entries. After the correct
// reset, the new offset should be (old_offset + shift). It should be noted that if the new offset is less than partition's
// earliest, it will be set to earliest, and if the latest greater than partition will be set to latest.
Shift *int `pulumi:"shift"`
// Unit ms. When strategy is 1, you must include this field, where-2 means to reset the offset to the beginning,-1 means to
// reset to the latest position (equivalent to emptying), and other values represent the specified time. You will get the
// offset of the specified time in the topic and then reset it. If there is no message at the specified time, get the last
// offset.
ShiftTimestamp *int `pulumi:"shiftTimestamp"`
// Reset the policy of offset. `0`: Move the offset forward or backward shift bar; `1`: Alignment reference
// (by-duration,to-datetime,to-earliest,to-latest), which means moving the offset to the location of the specified
// timestamp; `2`: Alignment reference (to-offset), which means to move the offset to the specified offset location.
Strategy int `pulumi:"strategy"`
// Indicates the topics that needs to be reset. Leave it empty means all.
Topics []string `pulumi:"topics"`
}
// The set of arguments for constructing a ConsumerGroupModifyOffset resource.
type ConsumerGroupModifyOffsetArgs struct {
// kafka group.
Group pulumi.StringInput
// Kafka instance id.
InstanceId pulumi.StringInput
// The offset location that needs to be reset. When strategy is 2, this field must be included.
Offset pulumi.IntPtrInput
// The list of partition that needs to be reset if no Topics parameter is specified. Resets the partition in the
// corresponding Partition list of all topics. When Topics is specified, the partition of the corresponding topic list of
// the specified Partitions list is reset.
Partitions pulumi.IntArrayInput
// This field must be included when strategy is 0. If it is greater than zero, the offset will be moved backward by shift
// bars, and if it is less than zero, the offset will be traced back to the number of shift entries. After the correct
// reset, the new offset should be (old_offset + shift). It should be noted that if the new offset is less than partition's
// earliest, it will be set to earliest, and if the latest greater than partition will be set to latest.
Shift pulumi.IntPtrInput
// Unit ms. When strategy is 1, you must include this field, where-2 means to reset the offset to the beginning,-1 means to
// reset to the latest position (equivalent to emptying), and other values represent the specified time. You will get the
// offset of the specified time in the topic and then reset it. If there is no message at the specified time, get the last
// offset.
ShiftTimestamp pulumi.IntPtrInput
// Reset the policy of offset. `0`: Move the offset forward or backward shift bar; `1`: Alignment reference
// (by-duration,to-datetime,to-earliest,to-latest), which means moving the offset to the location of the specified
// timestamp; `2`: Alignment reference (to-offset), which means to move the offset to the specified offset location.
Strategy pulumi.IntInput
// Indicates the topics that needs to be reset. Leave it empty means all.
Topics pulumi.StringArrayInput
}
func (ConsumerGroupModifyOffsetArgs) ElementType() reflect.Type {
return reflect.TypeOf((*consumerGroupModifyOffsetArgs)(nil)).Elem()
}
type ConsumerGroupModifyOffsetInput interface {
pulumi.Input
ToConsumerGroupModifyOffsetOutput() ConsumerGroupModifyOffsetOutput
ToConsumerGroupModifyOffsetOutputWithContext(ctx context.Context) ConsumerGroupModifyOffsetOutput
}
func (*ConsumerGroupModifyOffset) ElementType() reflect.Type {
return reflect.TypeOf((**ConsumerGroupModifyOffset)(nil)).Elem()
}
func (i *ConsumerGroupModifyOffset) ToConsumerGroupModifyOffsetOutput() ConsumerGroupModifyOffsetOutput {
return i.ToConsumerGroupModifyOffsetOutputWithContext(context.Background())
}
func (i *ConsumerGroupModifyOffset) ToConsumerGroupModifyOffsetOutputWithContext(ctx context.Context) ConsumerGroupModifyOffsetOutput {
return pulumi.ToOutputWithContext(ctx, i).(ConsumerGroupModifyOffsetOutput)
}
// ConsumerGroupModifyOffsetArrayInput is an input type that accepts ConsumerGroupModifyOffsetArray and ConsumerGroupModifyOffsetArrayOutput values.
// You can construct a concrete instance of `ConsumerGroupModifyOffsetArrayInput` via:
//
// ConsumerGroupModifyOffsetArray{ ConsumerGroupModifyOffsetArgs{...} }
type ConsumerGroupModifyOffsetArrayInput interface {
pulumi.Input
ToConsumerGroupModifyOffsetArrayOutput() ConsumerGroupModifyOffsetArrayOutput
ToConsumerGroupModifyOffsetArrayOutputWithContext(context.Context) ConsumerGroupModifyOffsetArrayOutput
}
type ConsumerGroupModifyOffsetArray []ConsumerGroupModifyOffsetInput
func (ConsumerGroupModifyOffsetArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ConsumerGroupModifyOffset)(nil)).Elem()
}
func (i ConsumerGroupModifyOffsetArray) ToConsumerGroupModifyOffsetArrayOutput() ConsumerGroupModifyOffsetArrayOutput {
return i.ToConsumerGroupModifyOffsetArrayOutputWithContext(context.Background())
}
func (i ConsumerGroupModifyOffsetArray) ToConsumerGroupModifyOffsetArrayOutputWithContext(ctx context.Context) ConsumerGroupModifyOffsetArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ConsumerGroupModifyOffsetArrayOutput)
}
// ConsumerGroupModifyOffsetMapInput is an input type that accepts ConsumerGroupModifyOffsetMap and ConsumerGroupModifyOffsetMapOutput values.
// You can construct a concrete instance of `ConsumerGroupModifyOffsetMapInput` via:
//
// ConsumerGroupModifyOffsetMap{ "key": ConsumerGroupModifyOffsetArgs{...} }
type ConsumerGroupModifyOffsetMapInput interface {
pulumi.Input
ToConsumerGroupModifyOffsetMapOutput() ConsumerGroupModifyOffsetMapOutput
ToConsumerGroupModifyOffsetMapOutputWithContext(context.Context) ConsumerGroupModifyOffsetMapOutput
}
type ConsumerGroupModifyOffsetMap map[string]ConsumerGroupModifyOffsetInput
func (ConsumerGroupModifyOffsetMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ConsumerGroupModifyOffset)(nil)).Elem()
}
func (i ConsumerGroupModifyOffsetMap) ToConsumerGroupModifyOffsetMapOutput() ConsumerGroupModifyOffsetMapOutput {
return i.ToConsumerGroupModifyOffsetMapOutputWithContext(context.Background())
}
func (i ConsumerGroupModifyOffsetMap) ToConsumerGroupModifyOffsetMapOutputWithContext(ctx context.Context) ConsumerGroupModifyOffsetMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ConsumerGroupModifyOffsetMapOutput)
}
type ConsumerGroupModifyOffsetOutput struct{ *pulumi.OutputState }
func (ConsumerGroupModifyOffsetOutput) ElementType() reflect.Type {
return reflect.TypeOf((**ConsumerGroupModifyOffset)(nil)).Elem()
}
func (o ConsumerGroupModifyOffsetOutput) ToConsumerGroupModifyOffsetOutput() ConsumerGroupModifyOffsetOutput {
return o
}
func (o ConsumerGroupModifyOffsetOutput) ToConsumerGroupModifyOffsetOutputWithContext(ctx context.Context) ConsumerGroupModifyOffsetOutput {
return o
}
// kafka group.
func (o ConsumerGroupModifyOffsetOutput) Group() pulumi.StringOutput {
return o.ApplyT(func(v *ConsumerGroupModifyOffset) pulumi.StringOutput { return v.Group }).(pulumi.StringOutput)
}
// Kafka instance id.
func (o ConsumerGroupModifyOffsetOutput) InstanceId() pulumi.StringOutput {
return o.ApplyT(func(v *ConsumerGroupModifyOffset) pulumi.StringOutput { return v.InstanceId }).(pulumi.StringOutput)
}
// The offset location that needs to be reset. When strategy is 2, this field must be included.
func (o ConsumerGroupModifyOffsetOutput) Offset() pulumi.IntPtrOutput {
return o.ApplyT(func(v *ConsumerGroupModifyOffset) pulumi.IntPtrOutput { return v.Offset }).(pulumi.IntPtrOutput)
}
// The list of partition that needs to be reset if no Topics parameter is specified. Resets the partition in the
// corresponding Partition list of all topics. When Topics is specified, the partition of the corresponding topic list of
// the specified Partitions list is reset.
func (o ConsumerGroupModifyOffsetOutput) Partitions() pulumi.IntArrayOutput {
return o.ApplyT(func(v *ConsumerGroupModifyOffset) pulumi.IntArrayOutput { return v.Partitions }).(pulumi.IntArrayOutput)
}
// This field must be included when strategy is 0. If it is greater than zero, the offset will be moved backward by shift
// bars, and if it is less than zero, the offset will be traced back to the number of shift entries. After the correct
// reset, the new offset should be (old_offset + shift). It should be noted that if the new offset is less than partition's
// earliest, it will be set to earliest, and if the latest greater than partition will be set to latest.
func (o ConsumerGroupModifyOffsetOutput) Shift() pulumi.IntPtrOutput {
return o.ApplyT(func(v *ConsumerGroupModifyOffset) pulumi.IntPtrOutput { return v.Shift }).(pulumi.IntPtrOutput)
}
// Unit ms. When strategy is 1, you must include this field, where-2 means to reset the offset to the beginning,-1 means to
// reset to the latest position (equivalent to emptying), and other values represent the specified time. You will get the
// offset of the specified time in the topic and then reset it. If there is no message at the specified time, get the last
// offset.
func (o ConsumerGroupModifyOffsetOutput) ShiftTimestamp() pulumi.IntPtrOutput {
return o.ApplyT(func(v *ConsumerGroupModifyOffset) pulumi.IntPtrOutput { return v.ShiftTimestamp }).(pulumi.IntPtrOutput)
}
// Reset the policy of offset. `0`: Move the offset forward or backward shift bar; `1`: Alignment reference
// (by-duration,to-datetime,to-earliest,to-latest), which means moving the offset to the location of the specified
// timestamp; `2`: Alignment reference (to-offset), which means to move the offset to the specified offset location.
func (o ConsumerGroupModifyOffsetOutput) Strategy() pulumi.IntOutput {
return o.ApplyT(func(v *ConsumerGroupModifyOffset) pulumi.IntOutput { return v.Strategy }).(pulumi.IntOutput)
}
// Indicates the topics that needs to be reset. Leave it empty means all.
func (o ConsumerGroupModifyOffsetOutput) Topics() pulumi.StringArrayOutput {
return o.ApplyT(func(v *ConsumerGroupModifyOffset) pulumi.StringArrayOutput { return v.Topics }).(pulumi.StringArrayOutput)
}
type ConsumerGroupModifyOffsetArrayOutput struct{ *pulumi.OutputState }
func (ConsumerGroupModifyOffsetArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*ConsumerGroupModifyOffset)(nil)).Elem()
}
func (o ConsumerGroupModifyOffsetArrayOutput) ToConsumerGroupModifyOffsetArrayOutput() ConsumerGroupModifyOffsetArrayOutput {
return o
}
func (o ConsumerGroupModifyOffsetArrayOutput) ToConsumerGroupModifyOffsetArrayOutputWithContext(ctx context.Context) ConsumerGroupModifyOffsetArrayOutput {
return o
}
func (o ConsumerGroupModifyOffsetArrayOutput) Index(i pulumi.IntInput) ConsumerGroupModifyOffsetOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ConsumerGroupModifyOffset {
return vs[0].([]*ConsumerGroupModifyOffset)[vs[1].(int)]
}).(ConsumerGroupModifyOffsetOutput)
}
type ConsumerGroupModifyOffsetMapOutput struct{ *pulumi.OutputState }
func (ConsumerGroupModifyOffsetMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*ConsumerGroupModifyOffset)(nil)).Elem()
}
func (o ConsumerGroupModifyOffsetMapOutput) ToConsumerGroupModifyOffsetMapOutput() ConsumerGroupModifyOffsetMapOutput {
return o
}
func (o ConsumerGroupModifyOffsetMapOutput) ToConsumerGroupModifyOffsetMapOutputWithContext(ctx context.Context) ConsumerGroupModifyOffsetMapOutput {
return o
}
func (o ConsumerGroupModifyOffsetMapOutput) MapIndex(k pulumi.StringInput) ConsumerGroupModifyOffsetOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ConsumerGroupModifyOffset {
return vs[0].(map[string]*ConsumerGroupModifyOffset)[vs[1].(string)]
}).(ConsumerGroupModifyOffsetOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ConsumerGroupModifyOffsetInput)(nil)).Elem(), &ConsumerGroupModifyOffset{})
pulumi.RegisterInputType(reflect.TypeOf((*ConsumerGroupModifyOffsetArrayInput)(nil)).Elem(), ConsumerGroupModifyOffsetArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ConsumerGroupModifyOffsetMapInput)(nil)).Elem(), ConsumerGroupModifyOffsetMap{})
pulumi.RegisterOutputType(ConsumerGroupModifyOffsetOutput{})
pulumi.RegisterOutputType(ConsumerGroupModifyOffsetArrayOutput{})
pulumi.RegisterOutputType(ConsumerGroupModifyOffsetMapOutput{})
}