github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/getNetworkInsightsPath.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  // `ec2.NetworkInsightsPath` provides details about a specific Network Insights Path.
    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/ec2"
    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 := ec2.LookupNetworkInsightsPath(ctx, &ec2.LookupNetworkInsightsPathArgs{
    32  //				NetworkInsightsPathId: pulumi.StringRef(exampleAwsEc2NetworkInsightsPath.Id),
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupNetworkInsightsPath(ctx *pulumi.Context, args *LookupNetworkInsightsPathArgs, opts ...pulumi.InvokeOption) (*LookupNetworkInsightsPathResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupNetworkInsightsPathResult
    46  	err := ctx.Invoke("aws:ec2/getNetworkInsightsPath:getNetworkInsightsPath", args, &rv, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return &rv, nil
    51  }
    52  
    53  // A collection of arguments for invoking getNetworkInsightsPath.
    54  type LookupNetworkInsightsPathArgs struct {
    55  	// Configuration block(s) for filtering. Detailed below.
    56  	Filters []GetNetworkInsightsPathFilter `pulumi:"filters"`
    57  	// ID of the Network Insights Path to select.
    58  	NetworkInsightsPathId *string `pulumi:"networkInsightsPathId"`
    59  	// Map of tags assigned to the resource.
    60  	Tags map[string]string `pulumi:"tags"`
    61  }
    62  
    63  // A collection of values returned by getNetworkInsightsPath.
    64  type LookupNetworkInsightsPathResult struct {
    65  	// ARN of the selected Network Insights Path.
    66  	Arn string `pulumi:"arn"`
    67  	// AWS resource that is the destination of the path.
    68  	Destination string `pulumi:"destination"`
    69  	// ARN of the destination.
    70  	DestinationArn string `pulumi:"destinationArn"`
    71  	// IP address of the AWS resource that is the destination of the path.
    72  	DestinationIp string `pulumi:"destinationIp"`
    73  	// Destination port.
    74  	DestinationPort int                            `pulumi:"destinationPort"`
    75  	Filters         []GetNetworkInsightsPathFilter `pulumi:"filters"`
    76  	// The provider-assigned unique ID for this managed resource.
    77  	Id                    string `pulumi:"id"`
    78  	NetworkInsightsPathId string `pulumi:"networkInsightsPathId"`
    79  	// Protocol.
    80  	Protocol string `pulumi:"protocol"`
    81  	// AWS resource that is the source of the path.
    82  	Source string `pulumi:"source"`
    83  	// ARN of the source.
    84  	SourceArn string `pulumi:"sourceArn"`
    85  	// IP address of the AWS resource that is the source of the path.
    86  	SourceIp string `pulumi:"sourceIp"`
    87  	// Map of tags assigned to the resource.
    88  	Tags map[string]string `pulumi:"tags"`
    89  }
    90  
    91  func LookupNetworkInsightsPathOutput(ctx *pulumi.Context, args LookupNetworkInsightsPathOutputArgs, opts ...pulumi.InvokeOption) LookupNetworkInsightsPathResultOutput {
    92  	return pulumi.ToOutputWithContext(context.Background(), args).
    93  		ApplyT(func(v interface{}) (LookupNetworkInsightsPathResult, error) {
    94  			args := v.(LookupNetworkInsightsPathArgs)
    95  			r, err := LookupNetworkInsightsPath(ctx, &args, opts...)
    96  			var s LookupNetworkInsightsPathResult
    97  			if r != nil {
    98  				s = *r
    99  			}
   100  			return s, err
   101  		}).(LookupNetworkInsightsPathResultOutput)
   102  }
   103  
   104  // A collection of arguments for invoking getNetworkInsightsPath.
   105  type LookupNetworkInsightsPathOutputArgs struct {
   106  	// Configuration block(s) for filtering. Detailed below.
   107  	Filters GetNetworkInsightsPathFilterArrayInput `pulumi:"filters"`
   108  	// ID of the Network Insights Path to select.
   109  	NetworkInsightsPathId pulumi.StringPtrInput `pulumi:"networkInsightsPathId"`
   110  	// Map of tags assigned to the resource.
   111  	Tags pulumi.StringMapInput `pulumi:"tags"`
   112  }
   113  
   114  func (LookupNetworkInsightsPathOutputArgs) ElementType() reflect.Type {
   115  	return reflect.TypeOf((*LookupNetworkInsightsPathArgs)(nil)).Elem()
   116  }
   117  
   118  // A collection of values returned by getNetworkInsightsPath.
   119  type LookupNetworkInsightsPathResultOutput struct{ *pulumi.OutputState }
   120  
   121  func (LookupNetworkInsightsPathResultOutput) ElementType() reflect.Type {
   122  	return reflect.TypeOf((*LookupNetworkInsightsPathResult)(nil)).Elem()
   123  }
   124  
   125  func (o LookupNetworkInsightsPathResultOutput) ToLookupNetworkInsightsPathResultOutput() LookupNetworkInsightsPathResultOutput {
   126  	return o
   127  }
   128  
   129  func (o LookupNetworkInsightsPathResultOutput) ToLookupNetworkInsightsPathResultOutputWithContext(ctx context.Context) LookupNetworkInsightsPathResultOutput {
   130  	return o
   131  }
   132  
   133  // ARN of the selected Network Insights Path.
   134  func (o LookupNetworkInsightsPathResultOutput) Arn() pulumi.StringOutput {
   135  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) string { return v.Arn }).(pulumi.StringOutput)
   136  }
   137  
   138  // AWS resource that is the destination of the path.
   139  func (o LookupNetworkInsightsPathResultOutput) Destination() pulumi.StringOutput {
   140  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) string { return v.Destination }).(pulumi.StringOutput)
   141  }
   142  
   143  // ARN of the destination.
   144  func (o LookupNetworkInsightsPathResultOutput) DestinationArn() pulumi.StringOutput {
   145  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) string { return v.DestinationArn }).(pulumi.StringOutput)
   146  }
   147  
   148  // IP address of the AWS resource that is the destination of the path.
   149  func (o LookupNetworkInsightsPathResultOutput) DestinationIp() pulumi.StringOutput {
   150  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) string { return v.DestinationIp }).(pulumi.StringOutput)
   151  }
   152  
   153  // Destination port.
   154  func (o LookupNetworkInsightsPathResultOutput) DestinationPort() pulumi.IntOutput {
   155  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) int { return v.DestinationPort }).(pulumi.IntOutput)
   156  }
   157  
   158  func (o LookupNetworkInsightsPathResultOutput) Filters() GetNetworkInsightsPathFilterArrayOutput {
   159  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) []GetNetworkInsightsPathFilter { return v.Filters }).(GetNetworkInsightsPathFilterArrayOutput)
   160  }
   161  
   162  // The provider-assigned unique ID for this managed resource.
   163  func (o LookupNetworkInsightsPathResultOutput) Id() pulumi.StringOutput {
   164  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) string { return v.Id }).(pulumi.StringOutput)
   165  }
   166  
   167  func (o LookupNetworkInsightsPathResultOutput) NetworkInsightsPathId() pulumi.StringOutput {
   168  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) string { return v.NetworkInsightsPathId }).(pulumi.StringOutput)
   169  }
   170  
   171  // Protocol.
   172  func (o LookupNetworkInsightsPathResultOutput) Protocol() pulumi.StringOutput {
   173  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) string { return v.Protocol }).(pulumi.StringOutput)
   174  }
   175  
   176  // AWS resource that is the source of the path.
   177  func (o LookupNetworkInsightsPathResultOutput) Source() pulumi.StringOutput {
   178  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) string { return v.Source }).(pulumi.StringOutput)
   179  }
   180  
   181  // ARN of the source.
   182  func (o LookupNetworkInsightsPathResultOutput) SourceArn() pulumi.StringOutput {
   183  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) string { return v.SourceArn }).(pulumi.StringOutput)
   184  }
   185  
   186  // IP address of the AWS resource that is the source of the path.
   187  func (o LookupNetworkInsightsPathResultOutput) SourceIp() pulumi.StringOutput {
   188  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) string { return v.SourceIp }).(pulumi.StringOutput)
   189  }
   190  
   191  // Map of tags assigned to the resource.
   192  func (o LookupNetworkInsightsPathResultOutput) Tags() pulumi.StringMapOutput {
   193  	return o.ApplyT(func(v LookupNetworkInsightsPathResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   194  }
   195  
   196  func init() {
   197  	pulumi.RegisterOutputType(LookupNetworkInsightsPathResultOutput{})
   198  }