github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/appmesh/getVirtualRouter.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 appmesh
     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  // The App Mesh Virtual Router data source allows details of an App Mesh Virtual Service to be retrieved by its name and mesh_name.
    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/appmesh"
    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 := appmesh.LookupVirtualRouter(ctx, &appmesh.LookupVirtualRouterArgs{
    32  //				Name:     "example-router-name",
    33  //				MeshName: "example-mesh-name",
    34  //			}, nil)
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  func LookupVirtualRouter(ctx *pulumi.Context, args *LookupVirtualRouterArgs, opts ...pulumi.InvokeOption) (*LookupVirtualRouterResult, error) {
    45  	opts = internal.PkgInvokeDefaultOpts(opts)
    46  	var rv LookupVirtualRouterResult
    47  	err := ctx.Invoke("aws:appmesh/getVirtualRouter:getVirtualRouter", 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 getVirtualRouter.
    55  type LookupVirtualRouterArgs struct {
    56  	// Name of the mesh in which the virtual router exists
    57  	MeshName  string  `pulumi:"meshName"`
    58  	MeshOwner *string `pulumi:"meshOwner"`
    59  	// Name of the virtual router.
    60  	Name string `pulumi:"name"`
    61  	// Map of tags.
    62  	Tags map[string]string `pulumi:"tags"`
    63  }
    64  
    65  // A collection of values returned by getVirtualRouter.
    66  type LookupVirtualRouterResult struct {
    67  	// ARN of the virtual router.
    68  	Arn string `pulumi:"arn"`
    69  	// Creation date of the virtual router.
    70  	CreatedDate string `pulumi:"createdDate"`
    71  	// The provider-assigned unique ID for this managed resource.
    72  	Id string `pulumi:"id"`
    73  	// Last update date of the virtual router.
    74  	LastUpdatedDate string `pulumi:"lastUpdatedDate"`
    75  	MeshName        string `pulumi:"meshName"`
    76  	MeshOwner       string `pulumi:"meshOwner"`
    77  	Name            string `pulumi:"name"`
    78  	// Resource owner's AWS account ID.
    79  	ResourceOwner string `pulumi:"resourceOwner"`
    80  	// Virtual routers specification. See the `appmesh.VirtualRouter` resource for details.
    81  	Specs []GetVirtualRouterSpec `pulumi:"specs"`
    82  	// Map of tags.
    83  	Tags map[string]string `pulumi:"tags"`
    84  }
    85  
    86  func LookupVirtualRouterOutput(ctx *pulumi.Context, args LookupVirtualRouterOutputArgs, opts ...pulumi.InvokeOption) LookupVirtualRouterResultOutput {
    87  	return pulumi.ToOutputWithContext(context.Background(), args).
    88  		ApplyT(func(v interface{}) (LookupVirtualRouterResult, error) {
    89  			args := v.(LookupVirtualRouterArgs)
    90  			r, err := LookupVirtualRouter(ctx, &args, opts...)
    91  			var s LookupVirtualRouterResult
    92  			if r != nil {
    93  				s = *r
    94  			}
    95  			return s, err
    96  		}).(LookupVirtualRouterResultOutput)
    97  }
    98  
    99  // A collection of arguments for invoking getVirtualRouter.
   100  type LookupVirtualRouterOutputArgs struct {
   101  	// Name of the mesh in which the virtual router exists
   102  	MeshName  pulumi.StringInput    `pulumi:"meshName"`
   103  	MeshOwner pulumi.StringPtrInput `pulumi:"meshOwner"`
   104  	// Name of the virtual router.
   105  	Name pulumi.StringInput `pulumi:"name"`
   106  	// Map of tags.
   107  	Tags pulumi.StringMapInput `pulumi:"tags"`
   108  }
   109  
   110  func (LookupVirtualRouterOutputArgs) ElementType() reflect.Type {
   111  	return reflect.TypeOf((*LookupVirtualRouterArgs)(nil)).Elem()
   112  }
   113  
   114  // A collection of values returned by getVirtualRouter.
   115  type LookupVirtualRouterResultOutput struct{ *pulumi.OutputState }
   116  
   117  func (LookupVirtualRouterResultOutput) ElementType() reflect.Type {
   118  	return reflect.TypeOf((*LookupVirtualRouterResult)(nil)).Elem()
   119  }
   120  
   121  func (o LookupVirtualRouterResultOutput) ToLookupVirtualRouterResultOutput() LookupVirtualRouterResultOutput {
   122  	return o
   123  }
   124  
   125  func (o LookupVirtualRouterResultOutput) ToLookupVirtualRouterResultOutputWithContext(ctx context.Context) LookupVirtualRouterResultOutput {
   126  	return o
   127  }
   128  
   129  // ARN of the virtual router.
   130  func (o LookupVirtualRouterResultOutput) Arn() pulumi.StringOutput {
   131  	return o.ApplyT(func(v LookupVirtualRouterResult) string { return v.Arn }).(pulumi.StringOutput)
   132  }
   133  
   134  // Creation date of the virtual router.
   135  func (o LookupVirtualRouterResultOutput) CreatedDate() pulumi.StringOutput {
   136  	return o.ApplyT(func(v LookupVirtualRouterResult) string { return v.CreatedDate }).(pulumi.StringOutput)
   137  }
   138  
   139  // The provider-assigned unique ID for this managed resource.
   140  func (o LookupVirtualRouterResultOutput) Id() pulumi.StringOutput {
   141  	return o.ApplyT(func(v LookupVirtualRouterResult) string { return v.Id }).(pulumi.StringOutput)
   142  }
   143  
   144  // Last update date of the virtual router.
   145  func (o LookupVirtualRouterResultOutput) LastUpdatedDate() pulumi.StringOutput {
   146  	return o.ApplyT(func(v LookupVirtualRouterResult) string { return v.LastUpdatedDate }).(pulumi.StringOutput)
   147  }
   148  
   149  func (o LookupVirtualRouterResultOutput) MeshName() pulumi.StringOutput {
   150  	return o.ApplyT(func(v LookupVirtualRouterResult) string { return v.MeshName }).(pulumi.StringOutput)
   151  }
   152  
   153  func (o LookupVirtualRouterResultOutput) MeshOwner() pulumi.StringOutput {
   154  	return o.ApplyT(func(v LookupVirtualRouterResult) string { return v.MeshOwner }).(pulumi.StringOutput)
   155  }
   156  
   157  func (o LookupVirtualRouterResultOutput) Name() pulumi.StringOutput {
   158  	return o.ApplyT(func(v LookupVirtualRouterResult) string { return v.Name }).(pulumi.StringOutput)
   159  }
   160  
   161  // Resource owner's AWS account ID.
   162  func (o LookupVirtualRouterResultOutput) ResourceOwner() pulumi.StringOutput {
   163  	return o.ApplyT(func(v LookupVirtualRouterResult) string { return v.ResourceOwner }).(pulumi.StringOutput)
   164  }
   165  
   166  // Virtual routers specification. See the `appmesh.VirtualRouter` resource for details.
   167  func (o LookupVirtualRouterResultOutput) Specs() GetVirtualRouterSpecArrayOutput {
   168  	return o.ApplyT(func(v LookupVirtualRouterResult) []GetVirtualRouterSpec { return v.Specs }).(GetVirtualRouterSpecArrayOutput)
   169  }
   170  
   171  // Map of tags.
   172  func (o LookupVirtualRouterResultOutput) Tags() pulumi.StringMapOutput {
   173  	return o.ApplyT(func(v LookupVirtualRouterResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   174  }
   175  
   176  func init() {
   177  	pulumi.RegisterOutputType(LookupVirtualRouterResultOutput{})
   178  }