-
Notifications
You must be signed in to change notification settings - Fork 5
/
getInstances.go
82 lines (77 loc) · 2.64 KB
/
getInstances.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
// *** 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 waf
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a WAF datasource to retrieve instances.
//
// For information about WAF and how to use it, see [What is Alibaba Cloud WAF](https://www.alibabacloud.com/help/doc-detail/28517.htm).
//
// > **NOTE:** Available in 1.90.0+ .
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/waf"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := 1
// opt1 := "rg-acfmwvv********"
// opt2 := "waf-cloud"
// _default, err := waf.GetInstances(ctx, &waf.GetInstancesArgs{
// Ids: []string{
// "waf-cn-09k********",
// },
// Status: &opt0,
// ResourceGroupId: &opt1,
// InstanceSource: &opt2,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("theFirstWafInstanceId", _default.Instances[0].Id)
// return nil
// })
// }
// ```
func GetInstances(ctx *pulumi.Context, args *GetInstancesArgs, opts ...pulumi.InvokeOption) (*GetInstancesResult, error) {
var rv GetInstancesResult
err := ctx.Invoke("alicloud:waf/getInstances:getInstances", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getInstances.
type GetInstancesArgs struct {
// A list of WAF instance IDs.
Ids []string `pulumi:"ids"`
// The source of the WAF instance.
InstanceSource *string `pulumi:"instanceSource"`
OutputFile *string `pulumi:"outputFile"`
// The ID of resource group to which WAF instance belongs.
ResourceGroupId *string `pulumi:"resourceGroupId"`
// The status of WAF instance to filter results. Optional value: `0`: The instance has expired, `1` : The instance has not expired and is working properly.
Status *int `pulumi:"status"`
}
// A collection of values returned by getInstances.
type GetInstancesResult struct {
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// (Optional) A list of WAF instance IDs.
Ids []string `pulumi:"ids"`
InstanceSource *string `pulumi:"instanceSource"`
// A list of WAF instances. Each element contains the following attributes:
Instances []GetInstancesInstance `pulumi:"instances"`
OutputFile *string `pulumi:"outputFile"`
ResourceGroupId *string `pulumi:"resourceGroupId"`
// Indicates whether the WAF instance has expired.
Status *int `pulumi:"status"`
}