github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2transitgateway/getRouteTableRoutes.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package ec2transitgateway 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Provides informations for routes of a specific transit gateway, such as state, type, cidr 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := ec2transitgateway.GetRouteTableRoutes(ctx, &ec2transitgateway.GetRouteTableRoutesArgs{ 32 // Filters: []ec2transitgateway.GetRouteTableRoutesFilter{ 33 // { 34 // Name: "type", 35 // Values: []string{ 36 // "propagated", 37 // }, 38 // }, 39 // }, 40 // TransitGatewayRouteTableId: example.Id, 41 // }, nil) 42 // if err != nil { 43 // return err 44 // } 45 // return nil 46 // }) 47 // } 48 // 49 // ``` 50 // <!--End PulumiCodeChooser --> 51 func GetRouteTableRoutes(ctx *pulumi.Context, args *GetRouteTableRoutesArgs, opts ...pulumi.InvokeOption) (*GetRouteTableRoutesResult, error) { 52 opts = internal.PkgInvokeDefaultOpts(opts) 53 var rv GetRouteTableRoutesResult 54 err := ctx.Invoke("aws:ec2transitgateway/getRouteTableRoutes:getRouteTableRoutes", args, &rv, opts...) 55 if err != nil { 56 return nil, err 57 } 58 return &rv, nil 59 } 60 61 // A collection of arguments for invoking getRouteTableRoutes. 62 type GetRouteTableRoutesArgs struct { 63 // Custom filter block as described below. 64 Filters []GetRouteTableRoutesFilter `pulumi:"filters"` 65 // Identifier of EC2 Transit Gateway Route Table. 66 // 67 // More complex filters can be expressed using one or more `filter` sub-blocks, 68 // which take the following arguments: 69 TransitGatewayRouteTableId string `pulumi:"transitGatewayRouteTableId"` 70 } 71 72 // A collection of values returned by getRouteTableRoutes. 73 type GetRouteTableRoutesResult struct { 74 Filters []GetRouteTableRoutesFilter `pulumi:"filters"` 75 // The provider-assigned unique ID for this managed resource. 76 Id string `pulumi:"id"` 77 // List of Transit Gateway Routes. 78 Routes []GetRouteTableRoutesRoute `pulumi:"routes"` 79 TransitGatewayRouteTableId string `pulumi:"transitGatewayRouteTableId"` 80 } 81 82 func GetRouteTableRoutesOutput(ctx *pulumi.Context, args GetRouteTableRoutesOutputArgs, opts ...pulumi.InvokeOption) GetRouteTableRoutesResultOutput { 83 return pulumi.ToOutputWithContext(context.Background(), args). 84 ApplyT(func(v interface{}) (GetRouteTableRoutesResult, error) { 85 args := v.(GetRouteTableRoutesArgs) 86 r, err := GetRouteTableRoutes(ctx, &args, opts...) 87 var s GetRouteTableRoutesResult 88 if r != nil { 89 s = *r 90 } 91 return s, err 92 }).(GetRouteTableRoutesResultOutput) 93 } 94 95 // A collection of arguments for invoking getRouteTableRoutes. 96 type GetRouteTableRoutesOutputArgs struct { 97 // Custom filter block as described below. 98 Filters GetRouteTableRoutesFilterArrayInput `pulumi:"filters"` 99 // Identifier of EC2 Transit Gateway Route Table. 100 // 101 // More complex filters can be expressed using one or more `filter` sub-blocks, 102 // which take the following arguments: 103 TransitGatewayRouteTableId pulumi.StringInput `pulumi:"transitGatewayRouteTableId"` 104 } 105 106 func (GetRouteTableRoutesOutputArgs) ElementType() reflect.Type { 107 return reflect.TypeOf((*GetRouteTableRoutesArgs)(nil)).Elem() 108 } 109 110 // A collection of values returned by getRouteTableRoutes. 111 type GetRouteTableRoutesResultOutput struct{ *pulumi.OutputState } 112 113 func (GetRouteTableRoutesResultOutput) ElementType() reflect.Type { 114 return reflect.TypeOf((*GetRouteTableRoutesResult)(nil)).Elem() 115 } 116 117 func (o GetRouteTableRoutesResultOutput) ToGetRouteTableRoutesResultOutput() GetRouteTableRoutesResultOutput { 118 return o 119 } 120 121 func (o GetRouteTableRoutesResultOutput) ToGetRouteTableRoutesResultOutputWithContext(ctx context.Context) GetRouteTableRoutesResultOutput { 122 return o 123 } 124 125 func (o GetRouteTableRoutesResultOutput) Filters() GetRouteTableRoutesFilterArrayOutput { 126 return o.ApplyT(func(v GetRouteTableRoutesResult) []GetRouteTableRoutesFilter { return v.Filters }).(GetRouteTableRoutesFilterArrayOutput) 127 } 128 129 // The provider-assigned unique ID for this managed resource. 130 func (o GetRouteTableRoutesResultOutput) Id() pulumi.StringOutput { 131 return o.ApplyT(func(v GetRouteTableRoutesResult) string { return v.Id }).(pulumi.StringOutput) 132 } 133 134 // List of Transit Gateway Routes. 135 func (o GetRouteTableRoutesResultOutput) Routes() GetRouteTableRoutesRouteArrayOutput { 136 return o.ApplyT(func(v GetRouteTableRoutesResult) []GetRouteTableRoutesRoute { return v.Routes }).(GetRouteTableRoutesRouteArrayOutput) 137 } 138 139 func (o GetRouteTableRoutesResultOutput) TransitGatewayRouteTableId() pulumi.StringOutput { 140 return o.ApplyT(func(v GetRouteTableRoutesResult) string { return v.TransitGatewayRouteTableId }).(pulumi.StringOutput) 141 } 142 143 func init() { 144 pulumi.RegisterOutputType(GetRouteTableRoutesResultOutput{}) 145 }