github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigateway/getVpcLink.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 apigateway
     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  // Use this data source to get the id of a VPC Link in
    15  // API Gateway. To fetch the VPC Link you must provide a name to match against.
    16  // As there is no unique name constraint on API Gateway VPC Links this data source will
    17  // error if there is more than one match.
    18  //
    19  // ## Example Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := apigateway.LookupVpcLink(ctx, &apigateway.LookupVpcLinkArgs{
    35  //				Name: "my-vpc-link",
    36  //			}, nil)
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  func LookupVpcLink(ctx *pulumi.Context, args *LookupVpcLinkArgs, opts ...pulumi.InvokeOption) (*LookupVpcLinkResult, error) {
    47  	opts = internal.PkgInvokeDefaultOpts(opts)
    48  	var rv LookupVpcLinkResult
    49  	err := ctx.Invoke("aws:apigateway/getVpcLink:getVpcLink", 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 getVpcLink.
    57  type LookupVpcLinkArgs struct {
    58  	// Name of the API Gateway VPC Link to look up. If no API Gateway VPC Link is found with this name, an error will be returned.
    59  	// If multiple API Gateway VPC Links are found with this name, an error will be returned.
    60  	Name string `pulumi:"name"`
    61  	// Key-value map of resource tags
    62  	Tags map[string]string `pulumi:"tags"`
    63  }
    64  
    65  // A collection of values returned by getVpcLink.
    66  type LookupVpcLinkResult struct {
    67  	// Description of the VPC link.
    68  	Description string `pulumi:"description"`
    69  	// Set to the ID of the found API Gateway VPC Link.
    70  	Id   string `pulumi:"id"`
    71  	Name string `pulumi:"name"`
    72  	// Status of the VPC link.
    73  	Status string `pulumi:"status"`
    74  	// Status message of the VPC link.
    75  	StatusMessage string `pulumi:"statusMessage"`
    76  	// Key-value map of resource tags
    77  	Tags map[string]string `pulumi:"tags"`
    78  	// List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
    79  	TargetArns []string `pulumi:"targetArns"`
    80  }
    81  
    82  func LookupVpcLinkOutput(ctx *pulumi.Context, args LookupVpcLinkOutputArgs, opts ...pulumi.InvokeOption) LookupVpcLinkResultOutput {
    83  	return pulumi.ToOutputWithContext(context.Background(), args).
    84  		ApplyT(func(v interface{}) (LookupVpcLinkResult, error) {
    85  			args := v.(LookupVpcLinkArgs)
    86  			r, err := LookupVpcLink(ctx, &args, opts...)
    87  			var s LookupVpcLinkResult
    88  			if r != nil {
    89  				s = *r
    90  			}
    91  			return s, err
    92  		}).(LookupVpcLinkResultOutput)
    93  }
    94  
    95  // A collection of arguments for invoking getVpcLink.
    96  type LookupVpcLinkOutputArgs struct {
    97  	// Name of the API Gateway VPC Link to look up. If no API Gateway VPC Link is found with this name, an error will be returned.
    98  	// If multiple API Gateway VPC Links are found with this name, an error will be returned.
    99  	Name pulumi.StringInput `pulumi:"name"`
   100  	// Key-value map of resource tags
   101  	Tags pulumi.StringMapInput `pulumi:"tags"`
   102  }
   103  
   104  func (LookupVpcLinkOutputArgs) ElementType() reflect.Type {
   105  	return reflect.TypeOf((*LookupVpcLinkArgs)(nil)).Elem()
   106  }
   107  
   108  // A collection of values returned by getVpcLink.
   109  type LookupVpcLinkResultOutput struct{ *pulumi.OutputState }
   110  
   111  func (LookupVpcLinkResultOutput) ElementType() reflect.Type {
   112  	return reflect.TypeOf((*LookupVpcLinkResult)(nil)).Elem()
   113  }
   114  
   115  func (o LookupVpcLinkResultOutput) ToLookupVpcLinkResultOutput() LookupVpcLinkResultOutput {
   116  	return o
   117  }
   118  
   119  func (o LookupVpcLinkResultOutput) ToLookupVpcLinkResultOutputWithContext(ctx context.Context) LookupVpcLinkResultOutput {
   120  	return o
   121  }
   122  
   123  // Description of the VPC link.
   124  func (o LookupVpcLinkResultOutput) Description() pulumi.StringOutput {
   125  	return o.ApplyT(func(v LookupVpcLinkResult) string { return v.Description }).(pulumi.StringOutput)
   126  }
   127  
   128  // Set to the ID of the found API Gateway VPC Link.
   129  func (o LookupVpcLinkResultOutput) Id() pulumi.StringOutput {
   130  	return o.ApplyT(func(v LookupVpcLinkResult) string { return v.Id }).(pulumi.StringOutput)
   131  }
   132  
   133  func (o LookupVpcLinkResultOutput) Name() pulumi.StringOutput {
   134  	return o.ApplyT(func(v LookupVpcLinkResult) string { return v.Name }).(pulumi.StringOutput)
   135  }
   136  
   137  // Status of the VPC link.
   138  func (o LookupVpcLinkResultOutput) Status() pulumi.StringOutput {
   139  	return o.ApplyT(func(v LookupVpcLinkResult) string { return v.Status }).(pulumi.StringOutput)
   140  }
   141  
   142  // Status message of the VPC link.
   143  func (o LookupVpcLinkResultOutput) StatusMessage() pulumi.StringOutput {
   144  	return o.ApplyT(func(v LookupVpcLinkResult) string { return v.StatusMessage }).(pulumi.StringOutput)
   145  }
   146  
   147  // Key-value map of resource tags
   148  func (o LookupVpcLinkResultOutput) Tags() pulumi.StringMapOutput {
   149  	return o.ApplyT(func(v LookupVpcLinkResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   150  }
   151  
   152  // List of network load balancer arns in the VPC targeted by the VPC link. Currently AWS only supports 1 target.
   153  func (o LookupVpcLinkResultOutput) TargetArns() pulumi.StringArrayOutput {
   154  	return o.ApplyT(func(v LookupVpcLinkResult) []string { return v.TargetArns }).(pulumi.StringArrayOutput)
   155  }
   156  
   157  func init() {
   158  	pulumi.RegisterOutputType(LookupVpcLinkResultOutput{})
   159  }