/
hybridMonitorSlsTask.go
330 lines (277 loc) · 14.7 KB
/
hybridMonitorSlsTask.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
// 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 cms
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Cloud Monitor Service Hybrid Monitor Sls Task resource.
//
// For information about Cloud Monitor Service Hybrid Monitor Sls Task and how to use it, see [What is Hybrid Monitor Sls Task](https://www.alibabacloud.com/help/en/cloudmonitor/latest/createhybridmonitortask).
//
// > **NOTE:** Available since v1.179.0.
//
// ## Import
//
// Cloud Monitor Service Hybrid Monitor Sls Task can be imported using the id, e.g.
//
// ```sh
// $ pulumi import alicloud:cms/hybridMonitorSlsTask:HybridMonitorSlsTask example <id>
// ```
type HybridMonitorSlsTask struct {
pulumi.CustomResourceState
// The label of the monitoring task. See `attachLabels` below.
AttachLabels HybridMonitorSlsTaskAttachLabelArrayOutput `pulumi:"attachLabels"`
// The interval at which metrics are collected. Valid values: `15`, `60`(default value). Unit: seconds.
CollectInterval pulumi.IntOutput `pulumi:"collectInterval"`
// The type of the collection target, enter the name of the Logstore group.
CollectTargetType pulumi.StringOutput `pulumi:"collectTargetType"`
// The description of the metric import task.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The name of the namespace.
Namespace pulumi.StringOutput `pulumi:"namespace"`
// The configurations of the logs that are imported from Log Service. See `slsProcessConfig` below.
SlsProcessConfig HybridMonitorSlsTaskSlsProcessConfigOutput `pulumi:"slsProcessConfig"`
// The name of the metric import task, enter the name of the metric for logs imported from Log Service.
TaskName pulumi.StringOutput `pulumi:"taskName"`
}
// NewHybridMonitorSlsTask registers a new resource with the given unique name, arguments, and options.
func NewHybridMonitorSlsTask(ctx *pulumi.Context,
name string, args *HybridMonitorSlsTaskArgs, opts ...pulumi.ResourceOption) (*HybridMonitorSlsTask, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.CollectTargetType == nil {
return nil, errors.New("invalid value for required argument 'CollectTargetType'")
}
if args.Namespace == nil {
return nil, errors.New("invalid value for required argument 'Namespace'")
}
if args.SlsProcessConfig == nil {
return nil, errors.New("invalid value for required argument 'SlsProcessConfig'")
}
if args.TaskName == nil {
return nil, errors.New("invalid value for required argument 'TaskName'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource HybridMonitorSlsTask
err := ctx.RegisterResource("alicloud:cms/hybridMonitorSlsTask:HybridMonitorSlsTask", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetHybridMonitorSlsTask gets an existing HybridMonitorSlsTask 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 GetHybridMonitorSlsTask(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *HybridMonitorSlsTaskState, opts ...pulumi.ResourceOption) (*HybridMonitorSlsTask, error) {
var resource HybridMonitorSlsTask
err := ctx.ReadResource("alicloud:cms/hybridMonitorSlsTask:HybridMonitorSlsTask", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering HybridMonitorSlsTask resources.
type hybridMonitorSlsTaskState struct {
// The label of the monitoring task. See `attachLabels` below.
AttachLabels []HybridMonitorSlsTaskAttachLabel `pulumi:"attachLabels"`
// The interval at which metrics are collected. Valid values: `15`, `60`(default value). Unit: seconds.
CollectInterval *int `pulumi:"collectInterval"`
// The type of the collection target, enter the name of the Logstore group.
CollectTargetType *string `pulumi:"collectTargetType"`
// The description of the metric import task.
Description *string `pulumi:"description"`
// The name of the namespace.
Namespace *string `pulumi:"namespace"`
// The configurations of the logs that are imported from Log Service. See `slsProcessConfig` below.
SlsProcessConfig *HybridMonitorSlsTaskSlsProcessConfig `pulumi:"slsProcessConfig"`
// The name of the metric import task, enter the name of the metric for logs imported from Log Service.
TaskName *string `pulumi:"taskName"`
}
type HybridMonitorSlsTaskState struct {
// The label of the monitoring task. See `attachLabels` below.
AttachLabels HybridMonitorSlsTaskAttachLabelArrayInput
// The interval at which metrics are collected. Valid values: `15`, `60`(default value). Unit: seconds.
CollectInterval pulumi.IntPtrInput
// The type of the collection target, enter the name of the Logstore group.
CollectTargetType pulumi.StringPtrInput
// The description of the metric import task.
Description pulumi.StringPtrInput
// The name of the namespace.
Namespace pulumi.StringPtrInput
// The configurations of the logs that are imported from Log Service. See `slsProcessConfig` below.
SlsProcessConfig HybridMonitorSlsTaskSlsProcessConfigPtrInput
// The name of the metric import task, enter the name of the metric for logs imported from Log Service.
TaskName pulumi.StringPtrInput
}
func (HybridMonitorSlsTaskState) ElementType() reflect.Type {
return reflect.TypeOf((*hybridMonitorSlsTaskState)(nil)).Elem()
}
type hybridMonitorSlsTaskArgs struct {
// The label of the monitoring task. See `attachLabels` below.
AttachLabels []HybridMonitorSlsTaskAttachLabel `pulumi:"attachLabels"`
// The interval at which metrics are collected. Valid values: `15`, `60`(default value). Unit: seconds.
CollectInterval *int `pulumi:"collectInterval"`
// The type of the collection target, enter the name of the Logstore group.
CollectTargetType string `pulumi:"collectTargetType"`
// The description of the metric import task.
Description *string `pulumi:"description"`
// The name of the namespace.
Namespace string `pulumi:"namespace"`
// The configurations of the logs that are imported from Log Service. See `slsProcessConfig` below.
SlsProcessConfig HybridMonitorSlsTaskSlsProcessConfig `pulumi:"slsProcessConfig"`
// The name of the metric import task, enter the name of the metric for logs imported from Log Service.
TaskName string `pulumi:"taskName"`
}
// The set of arguments for constructing a HybridMonitorSlsTask resource.
type HybridMonitorSlsTaskArgs struct {
// The label of the monitoring task. See `attachLabels` below.
AttachLabels HybridMonitorSlsTaskAttachLabelArrayInput
// The interval at which metrics are collected. Valid values: `15`, `60`(default value). Unit: seconds.
CollectInterval pulumi.IntPtrInput
// The type of the collection target, enter the name of the Logstore group.
CollectTargetType pulumi.StringInput
// The description of the metric import task.
Description pulumi.StringPtrInput
// The name of the namespace.
Namespace pulumi.StringInput
// The configurations of the logs that are imported from Log Service. See `slsProcessConfig` below.
SlsProcessConfig HybridMonitorSlsTaskSlsProcessConfigInput
// The name of the metric import task, enter the name of the metric for logs imported from Log Service.
TaskName pulumi.StringInput
}
func (HybridMonitorSlsTaskArgs) ElementType() reflect.Type {
return reflect.TypeOf((*hybridMonitorSlsTaskArgs)(nil)).Elem()
}
type HybridMonitorSlsTaskInput interface {
pulumi.Input
ToHybridMonitorSlsTaskOutput() HybridMonitorSlsTaskOutput
ToHybridMonitorSlsTaskOutputWithContext(ctx context.Context) HybridMonitorSlsTaskOutput
}
func (*HybridMonitorSlsTask) ElementType() reflect.Type {
return reflect.TypeOf((**HybridMonitorSlsTask)(nil)).Elem()
}
func (i *HybridMonitorSlsTask) ToHybridMonitorSlsTaskOutput() HybridMonitorSlsTaskOutput {
return i.ToHybridMonitorSlsTaskOutputWithContext(context.Background())
}
func (i *HybridMonitorSlsTask) ToHybridMonitorSlsTaskOutputWithContext(ctx context.Context) HybridMonitorSlsTaskOutput {
return pulumi.ToOutputWithContext(ctx, i).(HybridMonitorSlsTaskOutput)
}
// HybridMonitorSlsTaskArrayInput is an input type that accepts HybridMonitorSlsTaskArray and HybridMonitorSlsTaskArrayOutput values.
// You can construct a concrete instance of `HybridMonitorSlsTaskArrayInput` via:
//
// HybridMonitorSlsTaskArray{ HybridMonitorSlsTaskArgs{...} }
type HybridMonitorSlsTaskArrayInput interface {
pulumi.Input
ToHybridMonitorSlsTaskArrayOutput() HybridMonitorSlsTaskArrayOutput
ToHybridMonitorSlsTaskArrayOutputWithContext(context.Context) HybridMonitorSlsTaskArrayOutput
}
type HybridMonitorSlsTaskArray []HybridMonitorSlsTaskInput
func (HybridMonitorSlsTaskArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*HybridMonitorSlsTask)(nil)).Elem()
}
func (i HybridMonitorSlsTaskArray) ToHybridMonitorSlsTaskArrayOutput() HybridMonitorSlsTaskArrayOutput {
return i.ToHybridMonitorSlsTaskArrayOutputWithContext(context.Background())
}
func (i HybridMonitorSlsTaskArray) ToHybridMonitorSlsTaskArrayOutputWithContext(ctx context.Context) HybridMonitorSlsTaskArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(HybridMonitorSlsTaskArrayOutput)
}
// HybridMonitorSlsTaskMapInput is an input type that accepts HybridMonitorSlsTaskMap and HybridMonitorSlsTaskMapOutput values.
// You can construct a concrete instance of `HybridMonitorSlsTaskMapInput` via:
//
// HybridMonitorSlsTaskMap{ "key": HybridMonitorSlsTaskArgs{...} }
type HybridMonitorSlsTaskMapInput interface {
pulumi.Input
ToHybridMonitorSlsTaskMapOutput() HybridMonitorSlsTaskMapOutput
ToHybridMonitorSlsTaskMapOutputWithContext(context.Context) HybridMonitorSlsTaskMapOutput
}
type HybridMonitorSlsTaskMap map[string]HybridMonitorSlsTaskInput
func (HybridMonitorSlsTaskMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*HybridMonitorSlsTask)(nil)).Elem()
}
func (i HybridMonitorSlsTaskMap) ToHybridMonitorSlsTaskMapOutput() HybridMonitorSlsTaskMapOutput {
return i.ToHybridMonitorSlsTaskMapOutputWithContext(context.Background())
}
func (i HybridMonitorSlsTaskMap) ToHybridMonitorSlsTaskMapOutputWithContext(ctx context.Context) HybridMonitorSlsTaskMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(HybridMonitorSlsTaskMapOutput)
}
type HybridMonitorSlsTaskOutput struct{ *pulumi.OutputState }
func (HybridMonitorSlsTaskOutput) ElementType() reflect.Type {
return reflect.TypeOf((**HybridMonitorSlsTask)(nil)).Elem()
}
func (o HybridMonitorSlsTaskOutput) ToHybridMonitorSlsTaskOutput() HybridMonitorSlsTaskOutput {
return o
}
func (o HybridMonitorSlsTaskOutput) ToHybridMonitorSlsTaskOutputWithContext(ctx context.Context) HybridMonitorSlsTaskOutput {
return o
}
// The label of the monitoring task. See `attachLabels` below.
func (o HybridMonitorSlsTaskOutput) AttachLabels() HybridMonitorSlsTaskAttachLabelArrayOutput {
return o.ApplyT(func(v *HybridMonitorSlsTask) HybridMonitorSlsTaskAttachLabelArrayOutput { return v.AttachLabels }).(HybridMonitorSlsTaskAttachLabelArrayOutput)
}
// The interval at which metrics are collected. Valid values: `15`, `60`(default value). Unit: seconds.
func (o HybridMonitorSlsTaskOutput) CollectInterval() pulumi.IntOutput {
return o.ApplyT(func(v *HybridMonitorSlsTask) pulumi.IntOutput { return v.CollectInterval }).(pulumi.IntOutput)
}
// The type of the collection target, enter the name of the Logstore group.
func (o HybridMonitorSlsTaskOutput) CollectTargetType() pulumi.StringOutput {
return o.ApplyT(func(v *HybridMonitorSlsTask) pulumi.StringOutput { return v.CollectTargetType }).(pulumi.StringOutput)
}
// The description of the metric import task.
func (o HybridMonitorSlsTaskOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *HybridMonitorSlsTask) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The name of the namespace.
func (o HybridMonitorSlsTaskOutput) Namespace() pulumi.StringOutput {
return o.ApplyT(func(v *HybridMonitorSlsTask) pulumi.StringOutput { return v.Namespace }).(pulumi.StringOutput)
}
// The configurations of the logs that are imported from Log Service. See `slsProcessConfig` below.
func (o HybridMonitorSlsTaskOutput) SlsProcessConfig() HybridMonitorSlsTaskSlsProcessConfigOutput {
return o.ApplyT(func(v *HybridMonitorSlsTask) HybridMonitorSlsTaskSlsProcessConfigOutput { return v.SlsProcessConfig }).(HybridMonitorSlsTaskSlsProcessConfigOutput)
}
// The name of the metric import task, enter the name of the metric for logs imported from Log Service.
func (o HybridMonitorSlsTaskOutput) TaskName() pulumi.StringOutput {
return o.ApplyT(func(v *HybridMonitorSlsTask) pulumi.StringOutput { return v.TaskName }).(pulumi.StringOutput)
}
type HybridMonitorSlsTaskArrayOutput struct{ *pulumi.OutputState }
func (HybridMonitorSlsTaskArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*HybridMonitorSlsTask)(nil)).Elem()
}
func (o HybridMonitorSlsTaskArrayOutput) ToHybridMonitorSlsTaskArrayOutput() HybridMonitorSlsTaskArrayOutput {
return o
}
func (o HybridMonitorSlsTaskArrayOutput) ToHybridMonitorSlsTaskArrayOutputWithContext(ctx context.Context) HybridMonitorSlsTaskArrayOutput {
return o
}
func (o HybridMonitorSlsTaskArrayOutput) Index(i pulumi.IntInput) HybridMonitorSlsTaskOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *HybridMonitorSlsTask {
return vs[0].([]*HybridMonitorSlsTask)[vs[1].(int)]
}).(HybridMonitorSlsTaskOutput)
}
type HybridMonitorSlsTaskMapOutput struct{ *pulumi.OutputState }
func (HybridMonitorSlsTaskMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*HybridMonitorSlsTask)(nil)).Elem()
}
func (o HybridMonitorSlsTaskMapOutput) ToHybridMonitorSlsTaskMapOutput() HybridMonitorSlsTaskMapOutput {
return o
}
func (o HybridMonitorSlsTaskMapOutput) ToHybridMonitorSlsTaskMapOutputWithContext(ctx context.Context) HybridMonitorSlsTaskMapOutput {
return o
}
func (o HybridMonitorSlsTaskMapOutput) MapIndex(k pulumi.StringInput) HybridMonitorSlsTaskOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *HybridMonitorSlsTask {
return vs[0].(map[string]*HybridMonitorSlsTask)[vs[1].(string)]
}).(HybridMonitorSlsTaskOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*HybridMonitorSlsTaskInput)(nil)).Elem(), &HybridMonitorSlsTask{})
pulumi.RegisterInputType(reflect.TypeOf((*HybridMonitorSlsTaskArrayInput)(nil)).Elem(), HybridMonitorSlsTaskArray{})
pulumi.RegisterInputType(reflect.TypeOf((*HybridMonitorSlsTaskMapInput)(nil)).Elem(), HybridMonitorSlsTaskMap{})
pulumi.RegisterOutputType(HybridMonitorSlsTaskOutput{})
pulumi.RegisterOutputType(HybridMonitorSlsTaskArrayOutput{})
pulumi.RegisterOutputType(HybridMonitorSlsTaskMapOutput{})
}