github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2transitgateway/getRouteTableAssociations.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 information for multiple EC2 Transit Gateway Route Table Associations, such as their identifiers. 15 // 16 // ## Example Usage 17 // 18 // ### By Transit Gateway Identifier 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // _, err := ec2transitgateway.GetRouteTableAssociations(ctx, &ec2transitgateway.GetRouteTableAssociationsArgs{ 34 // TransitGatewayRouteTableId: exampleAwsEc2TransitGatewayRouteTable.Id, 35 // }, nil) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 func GetRouteTableAssociations(ctx *pulumi.Context, args *GetRouteTableAssociationsArgs, opts ...pulumi.InvokeOption) (*GetRouteTableAssociationsResult, error) { 46 opts = internal.PkgInvokeDefaultOpts(opts) 47 var rv GetRouteTableAssociationsResult 48 err := ctx.Invoke("aws:ec2transitgateway/getRouteTableAssociations:getRouteTableAssociations", args, &rv, opts...) 49 if err != nil { 50 return nil, err 51 } 52 return &rv, nil 53 } 54 55 // A collection of arguments for invoking getRouteTableAssociations. 56 type GetRouteTableAssociationsArgs struct { 57 // Custom filter block as described below. 58 // 59 // More complex filters can be expressed using one or more `filter` sub-blocks, 60 // which take the following arguments: 61 Filters []GetRouteTableAssociationsFilter `pulumi:"filters"` 62 // Identifier of EC2 Transit Gateway Route Table. 63 // 64 // The following arguments are optional: 65 TransitGatewayRouteTableId string `pulumi:"transitGatewayRouteTableId"` 66 } 67 68 // A collection of values returned by getRouteTableAssociations. 69 type GetRouteTableAssociationsResult struct { 70 Filters []GetRouteTableAssociationsFilter `pulumi:"filters"` 71 // The provider-assigned unique ID for this managed resource. 72 Id string `pulumi:"id"` 73 // Set of Transit Gateway Route Table Association identifiers. 74 Ids []string `pulumi:"ids"` 75 TransitGatewayRouteTableId string `pulumi:"transitGatewayRouteTableId"` 76 } 77 78 func GetRouteTableAssociationsOutput(ctx *pulumi.Context, args GetRouteTableAssociationsOutputArgs, opts ...pulumi.InvokeOption) GetRouteTableAssociationsResultOutput { 79 return pulumi.ToOutputWithContext(context.Background(), args). 80 ApplyT(func(v interface{}) (GetRouteTableAssociationsResult, error) { 81 args := v.(GetRouteTableAssociationsArgs) 82 r, err := GetRouteTableAssociations(ctx, &args, opts...) 83 var s GetRouteTableAssociationsResult 84 if r != nil { 85 s = *r 86 } 87 return s, err 88 }).(GetRouteTableAssociationsResultOutput) 89 } 90 91 // A collection of arguments for invoking getRouteTableAssociations. 92 type GetRouteTableAssociationsOutputArgs struct { 93 // Custom filter block as described below. 94 // 95 // More complex filters can be expressed using one or more `filter` sub-blocks, 96 // which take the following arguments: 97 Filters GetRouteTableAssociationsFilterArrayInput `pulumi:"filters"` 98 // Identifier of EC2 Transit Gateway Route Table. 99 // 100 // The following arguments are optional: 101 TransitGatewayRouteTableId pulumi.StringInput `pulumi:"transitGatewayRouteTableId"` 102 } 103 104 func (GetRouteTableAssociationsOutputArgs) ElementType() reflect.Type { 105 return reflect.TypeOf((*GetRouteTableAssociationsArgs)(nil)).Elem() 106 } 107 108 // A collection of values returned by getRouteTableAssociations. 109 type GetRouteTableAssociationsResultOutput struct{ *pulumi.OutputState } 110 111 func (GetRouteTableAssociationsResultOutput) ElementType() reflect.Type { 112 return reflect.TypeOf((*GetRouteTableAssociationsResult)(nil)).Elem() 113 } 114 115 func (o GetRouteTableAssociationsResultOutput) ToGetRouteTableAssociationsResultOutput() GetRouteTableAssociationsResultOutput { 116 return o 117 } 118 119 func (o GetRouteTableAssociationsResultOutput) ToGetRouteTableAssociationsResultOutputWithContext(ctx context.Context) GetRouteTableAssociationsResultOutput { 120 return o 121 } 122 123 func (o GetRouteTableAssociationsResultOutput) Filters() GetRouteTableAssociationsFilterArrayOutput { 124 return o.ApplyT(func(v GetRouteTableAssociationsResult) []GetRouteTableAssociationsFilter { return v.Filters }).(GetRouteTableAssociationsFilterArrayOutput) 125 } 126 127 // The provider-assigned unique ID for this managed resource. 128 func (o GetRouteTableAssociationsResultOutput) Id() pulumi.StringOutput { 129 return o.ApplyT(func(v GetRouteTableAssociationsResult) string { return v.Id }).(pulumi.StringOutput) 130 } 131 132 // Set of Transit Gateway Route Table Association identifiers. 133 func (o GetRouteTableAssociationsResultOutput) Ids() pulumi.StringArrayOutput { 134 return o.ApplyT(func(v GetRouteTableAssociationsResult) []string { return v.Ids }).(pulumi.StringArrayOutput) 135 } 136 137 func (o GetRouteTableAssociationsResultOutput) TransitGatewayRouteTableId() pulumi.StringOutput { 138 return o.ApplyT(func(v GetRouteTableAssociationsResult) string { return v.TransitGatewayRouteTableId }).(pulumi.StringOutput) 139 } 140 141 func init() { 142 pulumi.RegisterOutputType(GetRouteTableAssociationsResultOutput{}) 143 }