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