github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getVpnGateway.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  // The VPN Gateway data source provides details about
    15  // a specific VPN gateway.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			selected, err := ec2.LookupVpnGateway(ctx, &ec2.LookupVpnGatewayArgs{
    33  //				Filters: []ec2.GetVpnGatewayFilter{
    34  //					{
    35  //						Name: "tag:Name",
    36  //						Values: []string{
    37  //							"vpn-gw",
    38  //						},
    39  //					},
    40  //				},
    41  //			}, nil)
    42  //			if err != nil {
    43  //				return err
    44  //			}
    45  //			ctx.Export("vpnGatewayId", selected.Id)
    46  //			return nil
    47  //		})
    48  //	}
    49  //
    50  // ```
    51  // <!--End PulumiCodeChooser -->
    52  func LookupVpnGateway(ctx *pulumi.Context, args *LookupVpnGatewayArgs, opts ...pulumi.InvokeOption) (*LookupVpnGatewayResult, error) {
    53  	opts = internal.PkgInvokeDefaultOpts(opts)
    54  	var rv LookupVpnGatewayResult
    55  	err := ctx.Invoke("aws:ec2/getVpnGateway:getVpnGateway", args, &rv, opts...)
    56  	if err != nil {
    57  		return nil, err
    58  	}
    59  	return &rv, nil
    60  }
    61  
    62  // A collection of arguments for invoking getVpnGateway.
    63  type LookupVpnGatewayArgs struct {
    64  	// Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.
    65  	//
    66  	// More complex filters can be expressed using one or more `filter` sub-blocks,
    67  	// which take the following arguments:
    68  	AmazonSideAsn *string `pulumi:"amazonSideAsn"`
    69  	// ID of a VPC attached to the specific VPN Gateway to retrieve.
    70  	AttachedVpcId *string `pulumi:"attachedVpcId"`
    71  	// Availability Zone of the specific VPN Gateway to retrieve.
    72  	AvailabilityZone *string `pulumi:"availabilityZone"`
    73  	// Custom filter block as described below.
    74  	Filters []GetVpnGatewayFilter `pulumi:"filters"`
    75  	// ID of the specific VPN Gateway to retrieve.
    76  	Id *string `pulumi:"id"`
    77  	// State of the specific VPN Gateway to retrieve.
    78  	State *string `pulumi:"state"`
    79  	// Map of tags, each pair of which must exactly match
    80  	// a pair on the desired VPN Gateway.
    81  	Tags map[string]string `pulumi:"tags"`
    82  }
    83  
    84  // A collection of values returned by getVpnGateway.
    85  type LookupVpnGatewayResult struct {
    86  	AmazonSideAsn    string                `pulumi:"amazonSideAsn"`
    87  	Arn              string                `pulumi:"arn"`
    88  	AttachedVpcId    string                `pulumi:"attachedVpcId"`
    89  	AvailabilityZone string                `pulumi:"availabilityZone"`
    90  	Filters          []GetVpnGatewayFilter `pulumi:"filters"`
    91  	Id               string                `pulumi:"id"`
    92  	State            string                `pulumi:"state"`
    93  	Tags             map[string]string     `pulumi:"tags"`
    94  }
    95  
    96  func LookupVpnGatewayOutput(ctx *pulumi.Context, args LookupVpnGatewayOutputArgs, opts ...pulumi.InvokeOption) LookupVpnGatewayResultOutput {
    97  	return pulumi.ToOutputWithContext(context.Background(), args).
    98  		ApplyT(func(v interface{}) (LookupVpnGatewayResult, error) {
    99  			args := v.(LookupVpnGatewayArgs)
   100  			r, err := LookupVpnGateway(ctx, &args, opts...)
   101  			var s LookupVpnGatewayResult
   102  			if r != nil {
   103  				s = *r
   104  			}
   105  			return s, err
   106  		}).(LookupVpnGatewayResultOutput)
   107  }
   108  
   109  // A collection of arguments for invoking getVpnGateway.
   110  type LookupVpnGatewayOutputArgs struct {
   111  	// Autonomous System Number (ASN) for the Amazon side of the specific VPN Gateway to retrieve.
   112  	//
   113  	// More complex filters can be expressed using one or more `filter` sub-blocks,
   114  	// which take the following arguments:
   115  	AmazonSideAsn pulumi.StringPtrInput `pulumi:"amazonSideAsn"`
   116  	// ID of a VPC attached to the specific VPN Gateway to retrieve.
   117  	AttachedVpcId pulumi.StringPtrInput `pulumi:"attachedVpcId"`
   118  	// Availability Zone of the specific VPN Gateway to retrieve.
   119  	AvailabilityZone pulumi.StringPtrInput `pulumi:"availabilityZone"`
   120  	// Custom filter block as described below.
   121  	Filters GetVpnGatewayFilterArrayInput `pulumi:"filters"`
   122  	// ID of the specific VPN Gateway to retrieve.
   123  	Id pulumi.StringPtrInput `pulumi:"id"`
   124  	// State of the specific VPN Gateway to retrieve.
   125  	State pulumi.StringPtrInput `pulumi:"state"`
   126  	// Map of tags, each pair of which must exactly match
   127  	// a pair on the desired VPN Gateway.
   128  	Tags pulumi.StringMapInput `pulumi:"tags"`
   129  }
   130  
   131  func (LookupVpnGatewayOutputArgs) ElementType() reflect.Type {
   132  	return reflect.TypeOf((*LookupVpnGatewayArgs)(nil)).Elem()
   133  }
   134  
   135  // A collection of values returned by getVpnGateway.
   136  type LookupVpnGatewayResultOutput struct{ *pulumi.OutputState }
   137  
   138  func (LookupVpnGatewayResultOutput) ElementType() reflect.Type {
   139  	return reflect.TypeOf((*LookupVpnGatewayResult)(nil)).Elem()
   140  }
   141  
   142  func (o LookupVpnGatewayResultOutput) ToLookupVpnGatewayResultOutput() LookupVpnGatewayResultOutput {
   143  	return o
   144  }
   145  
   146  func (o LookupVpnGatewayResultOutput) ToLookupVpnGatewayResultOutputWithContext(ctx context.Context) LookupVpnGatewayResultOutput {
   147  	return o
   148  }
   149  
   150  func (o LookupVpnGatewayResultOutput) AmazonSideAsn() pulumi.StringOutput {
   151  	return o.ApplyT(func(v LookupVpnGatewayResult) string { return v.AmazonSideAsn }).(pulumi.StringOutput)
   152  }
   153  
   154  func (o LookupVpnGatewayResultOutput) Arn() pulumi.StringOutput {
   155  	return o.ApplyT(func(v LookupVpnGatewayResult) string { return v.Arn }).(pulumi.StringOutput)
   156  }
   157  
   158  func (o LookupVpnGatewayResultOutput) AttachedVpcId() pulumi.StringOutput {
   159  	return o.ApplyT(func(v LookupVpnGatewayResult) string { return v.AttachedVpcId }).(pulumi.StringOutput)
   160  }
   161  
   162  func (o LookupVpnGatewayResultOutput) AvailabilityZone() pulumi.StringOutput {
   163  	return o.ApplyT(func(v LookupVpnGatewayResult) string { return v.AvailabilityZone }).(pulumi.StringOutput)
   164  }
   165  
   166  func (o LookupVpnGatewayResultOutput) Filters() GetVpnGatewayFilterArrayOutput {
   167  	return o.ApplyT(func(v LookupVpnGatewayResult) []GetVpnGatewayFilter { return v.Filters }).(GetVpnGatewayFilterArrayOutput)
   168  }
   169  
   170  func (o LookupVpnGatewayResultOutput) Id() pulumi.StringOutput {
   171  	return o.ApplyT(func(v LookupVpnGatewayResult) string { return v.Id }).(pulumi.StringOutput)
   172  }
   173  
   174  func (o LookupVpnGatewayResultOutput) State() pulumi.StringOutput {
   175  	return o.ApplyT(func(v LookupVpnGatewayResult) string { return v.State }).(pulumi.StringOutput)
   176  }
   177  
   178  func (o LookupVpnGatewayResultOutput) Tags() pulumi.StringMapOutput {
   179  	return o.ApplyT(func(v LookupVpnGatewayResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   180  }
   181  
   182  func init() {
   183  	pulumi.RegisterOutputType(LookupVpnGatewayResultOutput{})
   184  }