github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/appmesh/getVirtualGateway.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  // Data source for managing an AWS App Mesh Virtual Gateway.
    15  //
    16  // ## Example Usage
    17  //
    18  // ### Basic Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appmesh"
    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 := appmesh.LookupVirtualGateway(ctx, &appmesh.LookupVirtualGatewayArgs{
    34  //				MeshName: "mesh-gateway",
    35  //				Name:     "example-mesh",
    36  //			}, nil)
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  func LookupVirtualGateway(ctx *pulumi.Context, args *LookupVirtualGatewayArgs, opts ...pulumi.InvokeOption) (*LookupVirtualGatewayResult, error) {
    47  	opts = internal.PkgInvokeDefaultOpts(opts)
    48  	var rv LookupVirtualGatewayResult
    49  	err := ctx.Invoke("aws:appmesh/getVirtualGateway:getVirtualGateway", args, &rv, opts...)
    50  	if err != nil {
    51  		return nil, err
    52  	}
    53  	return &rv, nil
    54  }
    55  
    56  // A collection of arguments for invoking getVirtualGateway.
    57  type LookupVirtualGatewayArgs struct {
    58  	// Name of the service mesh in which the virtual gateway exists.
    59  	MeshName string `pulumi:"meshName"`
    60  	// Name of the virtual gateway.
    61  	Name string `pulumi:"name"`
    62  	// Map of tags.
    63  	Tags map[string]string `pulumi:"tags"`
    64  }
    65  
    66  // A collection of values returned by getVirtualGateway.
    67  type LookupVirtualGatewayResult struct {
    68  	// ARN of the virtual gateway.
    69  	Arn string `pulumi:"arn"`
    70  	// Creation date of the virtual gateway.
    71  	CreatedDate string `pulumi:"createdDate"`
    72  	// The provider-assigned unique ID for this managed resource.
    73  	Id string `pulumi:"id"`
    74  	// Last update date of the virtual gateway.
    75  	LastUpdatedDate string `pulumi:"lastUpdatedDate"`
    76  	MeshName        string `pulumi:"meshName"`
    77  	MeshOwner       string `pulumi:"meshOwner"`
    78  	Name            string `pulumi:"name"`
    79  	// Resource owner's AWS account ID.
    80  	ResourceOwner string `pulumi:"resourceOwner"`
    81  	// Virtual gateway specification. See the `appmesh.VirtualGateway` resource for details.
    82  	Specs []GetVirtualGatewaySpec `pulumi:"specs"`
    83  	// Map of tags.
    84  	Tags map[string]string `pulumi:"tags"`
    85  }
    86  
    87  func LookupVirtualGatewayOutput(ctx *pulumi.Context, args LookupVirtualGatewayOutputArgs, opts ...pulumi.InvokeOption) LookupVirtualGatewayResultOutput {
    88  	return pulumi.ToOutputWithContext(context.Background(), args).
    89  		ApplyT(func(v interface{}) (LookupVirtualGatewayResult, error) {
    90  			args := v.(LookupVirtualGatewayArgs)
    91  			r, err := LookupVirtualGateway(ctx, &args, opts...)
    92  			var s LookupVirtualGatewayResult
    93  			if r != nil {
    94  				s = *r
    95  			}
    96  			return s, err
    97  		}).(LookupVirtualGatewayResultOutput)
    98  }
    99  
   100  // A collection of arguments for invoking getVirtualGateway.
   101  type LookupVirtualGatewayOutputArgs struct {
   102  	// Name of the service mesh in which the virtual gateway exists.
   103  	MeshName pulumi.StringInput `pulumi:"meshName"`
   104  	// Name of the virtual gateway.
   105  	Name pulumi.StringInput `pulumi:"name"`
   106  	// Map of tags.
   107  	Tags pulumi.StringMapInput `pulumi:"tags"`
   108  }
   109  
   110  func (LookupVirtualGatewayOutputArgs) ElementType() reflect.Type {
   111  	return reflect.TypeOf((*LookupVirtualGatewayArgs)(nil)).Elem()
   112  }
   113  
   114  // A collection of values returned by getVirtualGateway.
   115  type LookupVirtualGatewayResultOutput struct{ *pulumi.OutputState }
   116  
   117  func (LookupVirtualGatewayResultOutput) ElementType() reflect.Type {
   118  	return reflect.TypeOf((*LookupVirtualGatewayResult)(nil)).Elem()
   119  }
   120  
   121  func (o LookupVirtualGatewayResultOutput) ToLookupVirtualGatewayResultOutput() LookupVirtualGatewayResultOutput {
   122  	return o
   123  }
   124  
   125  func (o LookupVirtualGatewayResultOutput) ToLookupVirtualGatewayResultOutputWithContext(ctx context.Context) LookupVirtualGatewayResultOutput {
   126  	return o
   127  }
   128  
   129  // ARN of the virtual gateway.
   130  func (o LookupVirtualGatewayResultOutput) Arn() pulumi.StringOutput {
   131  	return o.ApplyT(func(v LookupVirtualGatewayResult) string { return v.Arn }).(pulumi.StringOutput)
   132  }
   133  
   134  // Creation date of the virtual gateway.
   135  func (o LookupVirtualGatewayResultOutput) CreatedDate() pulumi.StringOutput {
   136  	return o.ApplyT(func(v LookupVirtualGatewayResult) string { return v.CreatedDate }).(pulumi.StringOutput)
   137  }
   138  
   139  // The provider-assigned unique ID for this managed resource.
   140  func (o LookupVirtualGatewayResultOutput) Id() pulumi.StringOutput {
   141  	return o.ApplyT(func(v LookupVirtualGatewayResult) string { return v.Id }).(pulumi.StringOutput)
   142  }
   143  
   144  // Last update date of the virtual gateway.
   145  func (o LookupVirtualGatewayResultOutput) LastUpdatedDate() pulumi.StringOutput {
   146  	return o.ApplyT(func(v LookupVirtualGatewayResult) string { return v.LastUpdatedDate }).(pulumi.StringOutput)
   147  }
   148  
   149  func (o LookupVirtualGatewayResultOutput) MeshName() pulumi.StringOutput {
   150  	return o.ApplyT(func(v LookupVirtualGatewayResult) string { return v.MeshName }).(pulumi.StringOutput)
   151  }
   152  
   153  func (o LookupVirtualGatewayResultOutput) MeshOwner() pulumi.StringOutput {
   154  	return o.ApplyT(func(v LookupVirtualGatewayResult) string { return v.MeshOwner }).(pulumi.StringOutput)
   155  }
   156  
   157  func (o LookupVirtualGatewayResultOutput) Name() pulumi.StringOutput {
   158  	return o.ApplyT(func(v LookupVirtualGatewayResult) string { return v.Name }).(pulumi.StringOutput)
   159  }
   160  
   161  // Resource owner's AWS account ID.
   162  func (o LookupVirtualGatewayResultOutput) ResourceOwner() pulumi.StringOutput {
   163  	return o.ApplyT(func(v LookupVirtualGatewayResult) string { return v.ResourceOwner }).(pulumi.StringOutput)
   164  }
   165  
   166  // Virtual gateway specification. See the `appmesh.VirtualGateway` resource for details.
   167  func (o LookupVirtualGatewayResultOutput) Specs() GetVirtualGatewaySpecArrayOutput {
   168  	return o.ApplyT(func(v LookupVirtualGatewayResult) []GetVirtualGatewaySpec { return v.Specs }).(GetVirtualGatewaySpecArrayOutput)
   169  }
   170  
   171  // Map of tags.
   172  func (o LookupVirtualGatewayResultOutput) Tags() pulumi.StringMapOutput {
   173  	return o.ApplyT(func(v LookupVirtualGatewayResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   174  }
   175  
   176  func init() {
   177  	pulumi.RegisterOutputType(LookupVirtualGatewayResultOutput{})
   178  }