/
getRouteMaps.go
92 lines (87 loc) · 2.93 KB
/
getRouteMaps.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
// *** 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 cen
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// This data source provides CEN Route Maps available to the user.
//
// > **NOTE:** Available in v1.87.0+.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/cen"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := "cn-hangzhou"
// opt1 := "datasource_test"
// opt2 := "Active"
// opt3 := "RegionIn"
// this, err := cen.GetRouteMaps(ctx, &cen.GetRouteMapsArgs{
// CenId: "cen-ihdlgo87ai********",
// CenRegionId: &opt0,
// DescriptionRegex: &opt1,
// Ids: []string{
// "cenrmap-bnh97kb3mn********",
// },
// Status: &opt2,
// TransmitDirection: &opt3,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("firstCenRouteMapId", this.Maps[0].Id)
// return nil
// })
// }
// ```
func GetRouteMaps(ctx *pulumi.Context, args *GetRouteMapsArgs, opts ...pulumi.InvokeOption) (*GetRouteMapsResult, error) {
var rv GetRouteMapsResult
err := ctx.Invoke("alicloud:cen/getRouteMaps:getRouteMaps", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getRouteMaps.
type GetRouteMapsArgs struct {
// The ID of the CEN instance.
CenId string `pulumi:"cenId"`
// The ID of the region to which the CEN instance belongs.
CenRegionId *string `pulumi:"cenRegionId"`
// A regex string to filter CEN route map by description.
DescriptionRegex *string `pulumi:"descriptionRegex"`
// A list of CEN route map IDs.
Ids []string `pulumi:"ids"`
OutputFile *string `pulumi:"outputFile"`
// The status of the route map, including `Creating`, `Active` and `Deleting`.
Status *string `pulumi:"status"`
// The direction in which the route map is applied, including `RegionIn` and `RegionOut`.
TransmitDirection *string `pulumi:"transmitDirection"`
}
// A collection of values returned by getRouteMaps.
type GetRouteMapsResult struct {
// The ID of the CEN instance.
CenId string `pulumi:"cenId"`
// The ID of the region to which the CEN instance belongs.
CenRegionId *string `pulumi:"cenRegionId"`
DescriptionRegex *string `pulumi:"descriptionRegex"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// A list of CEN route map IDs.
Ids []string `pulumi:"ids"`
// A list of CEN instances. Each element contains the following attributes:
Maps []GetRouteMapsMap `pulumi:"maps"`
OutputFile *string `pulumi:"outputFile"`
// The status of the route map.
Status *string `pulumi:"status"`
// The direction in which the route map is applied.
TransmitDirection *string `pulumi:"transmitDirection"`
}