github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getRouteTables.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 ec2 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 // This resource can be useful for getting back a list of route table ids to be referenced elsewhere. 15 func GetRouteTables(ctx *pulumi.Context, args *GetRouteTablesArgs, opts ...pulumi.InvokeOption) (*GetRouteTablesResult, error) { 16 opts = internal.PkgInvokeDefaultOpts(opts) 17 var rv GetRouteTablesResult 18 err := ctx.Invoke("aws:ec2/getRouteTables:getRouteTables", args, &rv, opts...) 19 if err != nil { 20 return nil, err 21 } 22 return &rv, nil 23 } 24 25 // A collection of arguments for invoking getRouteTables. 26 type GetRouteTablesArgs struct { 27 // Custom filter block as described below. 28 Filters []GetRouteTablesFilter `pulumi:"filters"` 29 // Map of tags, each pair of which must exactly match 30 // a pair on the desired route tables. 31 // 32 // More complex filters can be expressed using one or more `filter` sub-blocks, 33 // which take the following arguments: 34 Tags map[string]string `pulumi:"tags"` 35 // VPC ID that you want to filter from. 36 VpcId *string `pulumi:"vpcId"` 37 } 38 39 // A collection of values returned by getRouteTables. 40 type GetRouteTablesResult struct { 41 Filters []GetRouteTablesFilter `pulumi:"filters"` 42 // The provider-assigned unique ID for this managed resource. 43 Id string `pulumi:"id"` 44 // List of all the route table ids found. 45 Ids []string `pulumi:"ids"` 46 Tags map[string]string `pulumi:"tags"` 47 VpcId *string `pulumi:"vpcId"` 48 } 49 50 func GetRouteTablesOutput(ctx *pulumi.Context, args GetRouteTablesOutputArgs, opts ...pulumi.InvokeOption) GetRouteTablesResultOutput { 51 return pulumi.ToOutputWithContext(context.Background(), args). 52 ApplyT(func(v interface{}) (GetRouteTablesResult, error) { 53 args := v.(GetRouteTablesArgs) 54 r, err := GetRouteTables(ctx, &args, opts...) 55 var s GetRouteTablesResult 56 if r != nil { 57 s = *r 58 } 59 return s, err 60 }).(GetRouteTablesResultOutput) 61 } 62 63 // A collection of arguments for invoking getRouteTables. 64 type GetRouteTablesOutputArgs struct { 65 // Custom filter block as described below. 66 Filters GetRouteTablesFilterArrayInput `pulumi:"filters"` 67 // Map of tags, each pair of which must exactly match 68 // a pair on the desired route tables. 69 // 70 // More complex filters can be expressed using one or more `filter` sub-blocks, 71 // which take the following arguments: 72 Tags pulumi.StringMapInput `pulumi:"tags"` 73 // VPC ID that you want to filter from. 74 VpcId pulumi.StringPtrInput `pulumi:"vpcId"` 75 } 76 77 func (GetRouteTablesOutputArgs) ElementType() reflect.Type { 78 return reflect.TypeOf((*GetRouteTablesArgs)(nil)).Elem() 79 } 80 81 // A collection of values returned by getRouteTables. 82 type GetRouteTablesResultOutput struct{ *pulumi.OutputState } 83 84 func (GetRouteTablesResultOutput) ElementType() reflect.Type { 85 return reflect.TypeOf((*GetRouteTablesResult)(nil)).Elem() 86 } 87 88 func (o GetRouteTablesResultOutput) ToGetRouteTablesResultOutput() GetRouteTablesResultOutput { 89 return o 90 } 91 92 func (o GetRouteTablesResultOutput) ToGetRouteTablesResultOutputWithContext(ctx context.Context) GetRouteTablesResultOutput { 93 return o 94 } 95 96 func (o GetRouteTablesResultOutput) Filters() GetRouteTablesFilterArrayOutput { 97 return o.ApplyT(func(v GetRouteTablesResult) []GetRouteTablesFilter { return v.Filters }).(GetRouteTablesFilterArrayOutput) 98 } 99 100 // The provider-assigned unique ID for this managed resource. 101 func (o GetRouteTablesResultOutput) Id() pulumi.StringOutput { 102 return o.ApplyT(func(v GetRouteTablesResult) string { return v.Id }).(pulumi.StringOutput) 103 } 104 105 // List of all the route table ids found. 106 func (o GetRouteTablesResultOutput) Ids() pulumi.StringArrayOutput { 107 return o.ApplyT(func(v GetRouteTablesResult) []string { return v.Ids }).(pulumi.StringArrayOutput) 108 } 109 110 func (o GetRouteTablesResultOutput) Tags() pulumi.StringMapOutput { 111 return o.ApplyT(func(v GetRouteTablesResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 112 } 113 114 func (o GetRouteTablesResultOutput) VpcId() pulumi.StringPtrOutput { 115 return o.ApplyT(func(v GetRouteTablesResult) *string { return v.VpcId }).(pulumi.StringPtrOutput) 116 } 117 118 func init() { 119 pulumi.RegisterOutputType(GetRouteTablesResultOutput{}) 120 }