github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2transitgateway/getConnectPeer.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 ec2transitgateway
     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  // Get information on an EC2 Transit Gateway Connect Peer.
    15  //
    16  // ## Example Usage
    17  //
    18  // ### By Filter
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
    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 := ec2transitgateway.LookupConnectPeer(ctx, &ec2transitgateway.LookupConnectPeerArgs{
    34  //				Filters: []ec2transitgateway.GetConnectPeerFilter{
    35  //					{
    36  //						Name: "transit-gateway-attachment-id",
    37  //						Values: []string{
    38  //							"tgw-attach-12345678",
    39  //						},
    40  //					},
    41  //				},
    42  //			}, nil)
    43  //			if err != nil {
    44  //				return err
    45  //			}
    46  //			return nil
    47  //		})
    48  //	}
    49  //
    50  // ```
    51  // <!--End PulumiCodeChooser -->
    52  //
    53  // ### By Identifier
    54  //
    55  // <!--Start PulumiCodeChooser -->
    56  // ```go
    57  // package main
    58  //
    59  // import (
    60  //
    61  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2transitgateway"
    62  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    63  //
    64  // )
    65  //
    66  //	func main() {
    67  //		pulumi.Run(func(ctx *pulumi.Context) error {
    68  //			_, err := ec2transitgateway.LookupConnectPeer(ctx, &ec2transitgateway.LookupConnectPeerArgs{
    69  //				TransitGatewayConnectPeerId: pulumi.StringRef("tgw-connect-peer-12345678"),
    70  //			}, nil)
    71  //			if err != nil {
    72  //				return err
    73  //			}
    74  //			return nil
    75  //		})
    76  //	}
    77  //
    78  // ```
    79  // <!--End PulumiCodeChooser -->
    80  func LookupConnectPeer(ctx *pulumi.Context, args *LookupConnectPeerArgs, opts ...pulumi.InvokeOption) (*LookupConnectPeerResult, error) {
    81  	opts = internal.PkgInvokeDefaultOpts(opts)
    82  	var rv LookupConnectPeerResult
    83  	err := ctx.Invoke("aws:ec2transitgateway/getConnectPeer:getConnectPeer", args, &rv, opts...)
    84  	if err != nil {
    85  		return nil, err
    86  	}
    87  	return &rv, nil
    88  }
    89  
    90  // A collection of arguments for invoking getConnectPeer.
    91  type LookupConnectPeerArgs struct {
    92  	// One or more configuration blocks containing name-values filters. Detailed below.
    93  	Filters []GetConnectPeerFilter `pulumi:"filters"`
    94  	// Key-value tags for the EC2 Transit Gateway Connect Peer
    95  	Tags map[string]string `pulumi:"tags"`
    96  	// Identifier of the EC2 Transit Gateway Connect Peer.
    97  	TransitGatewayConnectPeerId *string `pulumi:"transitGatewayConnectPeerId"`
    98  }
    99  
   100  // A collection of values returned by getConnectPeer.
   101  type LookupConnectPeerResult struct {
   102  	// EC2 Transit Gateway Connect Peer ARN
   103  	Arn string `pulumi:"arn"`
   104  	// BGP ASN number assigned customer device
   105  	BgpAsn string `pulumi:"bgpAsn"`
   106  	// The IP address assigned to customer device, which is used as BGP IP address.
   107  	BgpPeerAddress string `pulumi:"bgpPeerAddress"`
   108  	// The IP addresses assigned to Transit Gateway, which are used as BGP IP addresses.
   109  	BgpTransitGatewayAddresses []string               `pulumi:"bgpTransitGatewayAddresses"`
   110  	Filters                    []GetConnectPeerFilter `pulumi:"filters"`
   111  	// The provider-assigned unique ID for this managed resource.
   112  	Id string `pulumi:"id"`
   113  	// CIDR blocks that will be used for addressing within the tunnel.
   114  	InsideCidrBlocks []string `pulumi:"insideCidrBlocks"`
   115  	// IP addressed assigned to customer device, which is used as tunnel endpoint
   116  	PeerAddress string `pulumi:"peerAddress"`
   117  	// Key-value tags for the EC2 Transit Gateway Connect Peer
   118  	Tags map[string]string `pulumi:"tags"`
   119  	// The IP address assigned to Transit Gateway, which is used as tunnel endpoint.
   120  	TransitGatewayAddress string `pulumi:"transitGatewayAddress"`
   121  	// The Transit Gateway Connect
   122  	TransitGatewayAttachmentId  string `pulumi:"transitGatewayAttachmentId"`
   123  	TransitGatewayConnectPeerId string `pulumi:"transitGatewayConnectPeerId"`
   124  }
   125  
   126  func LookupConnectPeerOutput(ctx *pulumi.Context, args LookupConnectPeerOutputArgs, opts ...pulumi.InvokeOption) LookupConnectPeerResultOutput {
   127  	return pulumi.ToOutputWithContext(context.Background(), args).
   128  		ApplyT(func(v interface{}) (LookupConnectPeerResult, error) {
   129  			args := v.(LookupConnectPeerArgs)
   130  			r, err := LookupConnectPeer(ctx, &args, opts...)
   131  			var s LookupConnectPeerResult
   132  			if r != nil {
   133  				s = *r
   134  			}
   135  			return s, err
   136  		}).(LookupConnectPeerResultOutput)
   137  }
   138  
   139  // A collection of arguments for invoking getConnectPeer.
   140  type LookupConnectPeerOutputArgs struct {
   141  	// One or more configuration blocks containing name-values filters. Detailed below.
   142  	Filters GetConnectPeerFilterArrayInput `pulumi:"filters"`
   143  	// Key-value tags for the EC2 Transit Gateway Connect Peer
   144  	Tags pulumi.StringMapInput `pulumi:"tags"`
   145  	// Identifier of the EC2 Transit Gateway Connect Peer.
   146  	TransitGatewayConnectPeerId pulumi.StringPtrInput `pulumi:"transitGatewayConnectPeerId"`
   147  }
   148  
   149  func (LookupConnectPeerOutputArgs) ElementType() reflect.Type {
   150  	return reflect.TypeOf((*LookupConnectPeerArgs)(nil)).Elem()
   151  }
   152  
   153  // A collection of values returned by getConnectPeer.
   154  type LookupConnectPeerResultOutput struct{ *pulumi.OutputState }
   155  
   156  func (LookupConnectPeerResultOutput) ElementType() reflect.Type {
   157  	return reflect.TypeOf((*LookupConnectPeerResult)(nil)).Elem()
   158  }
   159  
   160  func (o LookupConnectPeerResultOutput) ToLookupConnectPeerResultOutput() LookupConnectPeerResultOutput {
   161  	return o
   162  }
   163  
   164  func (o LookupConnectPeerResultOutput) ToLookupConnectPeerResultOutputWithContext(ctx context.Context) LookupConnectPeerResultOutput {
   165  	return o
   166  }
   167  
   168  // EC2 Transit Gateway Connect Peer ARN
   169  func (o LookupConnectPeerResultOutput) Arn() pulumi.StringOutput {
   170  	return o.ApplyT(func(v LookupConnectPeerResult) string { return v.Arn }).(pulumi.StringOutput)
   171  }
   172  
   173  // BGP ASN number assigned customer device
   174  func (o LookupConnectPeerResultOutput) BgpAsn() pulumi.StringOutput {
   175  	return o.ApplyT(func(v LookupConnectPeerResult) string { return v.BgpAsn }).(pulumi.StringOutput)
   176  }
   177  
   178  // The IP address assigned to customer device, which is used as BGP IP address.
   179  func (o LookupConnectPeerResultOutput) BgpPeerAddress() pulumi.StringOutput {
   180  	return o.ApplyT(func(v LookupConnectPeerResult) string { return v.BgpPeerAddress }).(pulumi.StringOutput)
   181  }
   182  
   183  // The IP addresses assigned to Transit Gateway, which are used as BGP IP addresses.
   184  func (o LookupConnectPeerResultOutput) BgpTransitGatewayAddresses() pulumi.StringArrayOutput {
   185  	return o.ApplyT(func(v LookupConnectPeerResult) []string { return v.BgpTransitGatewayAddresses }).(pulumi.StringArrayOutput)
   186  }
   187  
   188  func (o LookupConnectPeerResultOutput) Filters() GetConnectPeerFilterArrayOutput {
   189  	return o.ApplyT(func(v LookupConnectPeerResult) []GetConnectPeerFilter { return v.Filters }).(GetConnectPeerFilterArrayOutput)
   190  }
   191  
   192  // The provider-assigned unique ID for this managed resource.
   193  func (o LookupConnectPeerResultOutput) Id() pulumi.StringOutput {
   194  	return o.ApplyT(func(v LookupConnectPeerResult) string { return v.Id }).(pulumi.StringOutput)
   195  }
   196  
   197  // CIDR blocks that will be used for addressing within the tunnel.
   198  func (o LookupConnectPeerResultOutput) InsideCidrBlocks() pulumi.StringArrayOutput {
   199  	return o.ApplyT(func(v LookupConnectPeerResult) []string { return v.InsideCidrBlocks }).(pulumi.StringArrayOutput)
   200  }
   201  
   202  // IP addressed assigned to customer device, which is used as tunnel endpoint
   203  func (o LookupConnectPeerResultOutput) PeerAddress() pulumi.StringOutput {
   204  	return o.ApplyT(func(v LookupConnectPeerResult) string { return v.PeerAddress }).(pulumi.StringOutput)
   205  }
   206  
   207  // Key-value tags for the EC2 Transit Gateway Connect Peer
   208  func (o LookupConnectPeerResultOutput) Tags() pulumi.StringMapOutput {
   209  	return o.ApplyT(func(v LookupConnectPeerResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   210  }
   211  
   212  // The IP address assigned to Transit Gateway, which is used as tunnel endpoint.
   213  func (o LookupConnectPeerResultOutput) TransitGatewayAddress() pulumi.StringOutput {
   214  	return o.ApplyT(func(v LookupConnectPeerResult) string { return v.TransitGatewayAddress }).(pulumi.StringOutput)
   215  }
   216  
   217  // The Transit Gateway Connect
   218  func (o LookupConnectPeerResultOutput) TransitGatewayAttachmentId() pulumi.StringOutput {
   219  	return o.ApplyT(func(v LookupConnectPeerResult) string { return v.TransitGatewayAttachmentId }).(pulumi.StringOutput)
   220  }
   221  
   222  func (o LookupConnectPeerResultOutput) TransitGatewayConnectPeerId() pulumi.StringOutput {
   223  	return o.ApplyT(func(v LookupConnectPeerResult) string { return v.TransitGatewayConnectPeerId }).(pulumi.StringOutput)
   224  }
   225  
   226  func init() {
   227  	pulumi.RegisterOutputType(LookupConnectPeerResultOutput{})
   228  }