/
getConsumerGroups.go
68 lines (63 loc) · 2.15 KB
/
getConsumerGroups.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package actiontrail
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// This data source provides a list of ALIKAFKA Consumer Groups in an Alibaba Cloud account according to the specified filters.
//
// > **NOTE:** Available in 1.56.0+
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/actiontrail"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := "CID-alikafkaGroupDatasourceName"
// opt1 := "consumerGroups.txt"
// consumerGroupsDs, err := actiontrail.GetConsumerGroups(ctx, &actiontrail.GetConsumerGroupsArgs{
// ConsumerIdRegex: &opt0,
// InstanceId: "xxx",
// OutputFile: &opt1,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("firstGroupName", consumerGroupsDs.ConsumerIds[0])
// return nil
// })
// }
// ```
func GetConsumerGroups(ctx *pulumi.Context, args *GetConsumerGroupsArgs, opts ...pulumi.InvokeOption) (*GetConsumerGroupsResult, error) {
var rv GetConsumerGroupsResult
err := ctx.Invoke("alicloud:actiontrail/getConsumerGroups:getConsumerGroups", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getConsumerGroups.
type GetConsumerGroupsArgs struct {
// A regex string to filter results by the consumer group id.
ConsumerIdRegex *string `pulumi:"consumerIdRegex"`
// ID of the ALIKAFKA Instance that owns the consumer groups.
InstanceId string `pulumi:"instanceId"`
OutputFile *string `pulumi:"outputFile"`
}
// A collection of values returned by getConsumerGroups.
type GetConsumerGroupsResult struct {
ConsumerIdRegex *string `pulumi:"consumerIdRegex"`
// A list of consumer group ids.
ConsumerIds []string `pulumi:"consumerIds"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
InstanceId string `pulumi:"instanceId"`
OutputFile *string `pulumi:"outputFile"`
}