github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/networkInsightsPath.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  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides a Network Insights Path resource. Part of the "Reachability Analyzer" service in the AWS VPC console.
    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  //			_, err := ec2.NewNetworkInsightsPath(ctx, "test", &ec2.NetworkInsightsPathArgs{
    33  //				Source:      pulumi.Any(source.Id),
    34  //				Destination: pulumi.Any(destination.Id),
    35  //				Protocol:    pulumi.String("tcp"),
    36  //			})
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  //
    47  // ## Import
    48  //
    49  // Using `pulumi import`, import Network Insights Paths using the `id`. For example:
    50  //
    51  // ```sh
    52  // $ pulumi import aws:ec2/networkInsightsPath:NetworkInsightsPath test nip-00edfba169923aefd
    53  // ```
    54  type NetworkInsightsPath struct {
    55  	pulumi.CustomResourceState
    56  
    57  	// ARN of the Network Insights Path.
    58  	Arn pulumi.StringOutput `pulumi:"arn"`
    59  	// ID or ARN of the resource which is the destination of the path. Can be an Instance, Internet Gateway, Network Interface, Transit Gateway, VPC Endpoint, VPC Peering Connection or VPN Gateway. If the resource is in another account, you must specify an ARN.
    60  	Destination pulumi.StringOutput `pulumi:"destination"`
    61  	// ARN of the destination.
    62  	DestinationArn pulumi.StringOutput `pulumi:"destinationArn"`
    63  	// IP address of the destination resource.
    64  	DestinationIp pulumi.StringPtrOutput `pulumi:"destinationIp"`
    65  	// Destination port to analyze access to.
    66  	DestinationPort pulumi.IntPtrOutput `pulumi:"destinationPort"`
    67  	// Protocol to use for analysis. Valid options are `tcp` or `udp`.
    68  	//
    69  	// The following arguments are optional:
    70  	Protocol pulumi.StringOutput `pulumi:"protocol"`
    71  	// ID or ARN of the resource which is the source of the path. Can be an Instance, Internet Gateway, Network Interface, Transit Gateway, VPC Endpoint, VPC Peering Connection or VPN Gateway. If the resource is in another account, you must specify an ARN.
    72  	Source pulumi.StringOutput `pulumi:"source"`
    73  	// ARN of the source.
    74  	SourceArn pulumi.StringOutput `pulumi:"sourceArn"`
    75  	// IP address of the source resource.
    76  	SourceIp pulumi.StringPtrOutput `pulumi:"sourceIp"`
    77  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    78  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    79  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    80  	//
    81  	// Deprecated: Please use `tags` instead.
    82  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    83  }
    84  
    85  // NewNetworkInsightsPath registers a new resource with the given unique name, arguments, and options.
    86  func NewNetworkInsightsPath(ctx *pulumi.Context,
    87  	name string, args *NetworkInsightsPathArgs, opts ...pulumi.ResourceOption) (*NetworkInsightsPath, error) {
    88  	if args == nil {
    89  		return nil, errors.New("missing one or more required arguments")
    90  	}
    91  
    92  	if args.Destination == nil {
    93  		return nil, errors.New("invalid value for required argument 'Destination'")
    94  	}
    95  	if args.Protocol == nil {
    96  		return nil, errors.New("invalid value for required argument 'Protocol'")
    97  	}
    98  	if args.Source == nil {
    99  		return nil, errors.New("invalid value for required argument 'Source'")
   100  	}
   101  	opts = internal.PkgResourceDefaultOpts(opts)
   102  	var resource NetworkInsightsPath
   103  	err := ctx.RegisterResource("aws:ec2/networkInsightsPath:NetworkInsightsPath", name, args, &resource, opts...)
   104  	if err != nil {
   105  		return nil, err
   106  	}
   107  	return &resource, nil
   108  }
   109  
   110  // GetNetworkInsightsPath gets an existing NetworkInsightsPath resource's state with the given name, ID, and optional
   111  // state properties that are used to uniquely qualify the lookup (nil if not required).
   112  func GetNetworkInsightsPath(ctx *pulumi.Context,
   113  	name string, id pulumi.IDInput, state *NetworkInsightsPathState, opts ...pulumi.ResourceOption) (*NetworkInsightsPath, error) {
   114  	var resource NetworkInsightsPath
   115  	err := ctx.ReadResource("aws:ec2/networkInsightsPath:NetworkInsightsPath", name, id, state, &resource, opts...)
   116  	if err != nil {
   117  		return nil, err
   118  	}
   119  	return &resource, nil
   120  }
   121  
   122  // Input properties used for looking up and filtering NetworkInsightsPath resources.
   123  type networkInsightsPathState struct {
   124  	// ARN of the Network Insights Path.
   125  	Arn *string `pulumi:"arn"`
   126  	// ID or ARN of the resource which is the destination of the path. Can be an Instance, Internet Gateway, Network Interface, Transit Gateway, VPC Endpoint, VPC Peering Connection or VPN Gateway. If the resource is in another account, you must specify an ARN.
   127  	Destination *string `pulumi:"destination"`
   128  	// ARN of the destination.
   129  	DestinationArn *string `pulumi:"destinationArn"`
   130  	// IP address of the destination resource.
   131  	DestinationIp *string `pulumi:"destinationIp"`
   132  	// Destination port to analyze access to.
   133  	DestinationPort *int `pulumi:"destinationPort"`
   134  	// Protocol to use for analysis. Valid options are `tcp` or `udp`.
   135  	//
   136  	// The following arguments are optional:
   137  	Protocol *string `pulumi:"protocol"`
   138  	// ID or ARN of the resource which is the source of the path. Can be an Instance, Internet Gateway, Network Interface, Transit Gateway, VPC Endpoint, VPC Peering Connection or VPN Gateway. If the resource is in another account, you must specify an ARN.
   139  	Source *string `pulumi:"source"`
   140  	// ARN of the source.
   141  	SourceArn *string `pulumi:"sourceArn"`
   142  	// IP address of the source resource.
   143  	SourceIp *string `pulumi:"sourceIp"`
   144  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   145  	Tags map[string]string `pulumi:"tags"`
   146  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   147  	//
   148  	// Deprecated: Please use `tags` instead.
   149  	TagsAll map[string]string `pulumi:"tagsAll"`
   150  }
   151  
   152  type NetworkInsightsPathState struct {
   153  	// ARN of the Network Insights Path.
   154  	Arn pulumi.StringPtrInput
   155  	// ID or ARN of the resource which is the destination of the path. Can be an Instance, Internet Gateway, Network Interface, Transit Gateway, VPC Endpoint, VPC Peering Connection or VPN Gateway. If the resource is in another account, you must specify an ARN.
   156  	Destination pulumi.StringPtrInput
   157  	// ARN of the destination.
   158  	DestinationArn pulumi.StringPtrInput
   159  	// IP address of the destination resource.
   160  	DestinationIp pulumi.StringPtrInput
   161  	// Destination port to analyze access to.
   162  	DestinationPort pulumi.IntPtrInput
   163  	// Protocol to use for analysis. Valid options are `tcp` or `udp`.
   164  	//
   165  	// The following arguments are optional:
   166  	Protocol pulumi.StringPtrInput
   167  	// ID or ARN of the resource which is the source of the path. Can be an Instance, Internet Gateway, Network Interface, Transit Gateway, VPC Endpoint, VPC Peering Connection or VPN Gateway. If the resource is in another account, you must specify an ARN.
   168  	Source pulumi.StringPtrInput
   169  	// ARN of the source.
   170  	SourceArn pulumi.StringPtrInput
   171  	// IP address of the source resource.
   172  	SourceIp pulumi.StringPtrInput
   173  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   174  	Tags pulumi.StringMapInput
   175  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   176  	//
   177  	// Deprecated: Please use `tags` instead.
   178  	TagsAll pulumi.StringMapInput
   179  }
   180  
   181  func (NetworkInsightsPathState) ElementType() reflect.Type {
   182  	return reflect.TypeOf((*networkInsightsPathState)(nil)).Elem()
   183  }
   184  
   185  type networkInsightsPathArgs struct {
   186  	// ID or ARN of the resource which is the destination of the path. Can be an Instance, Internet Gateway, Network Interface, Transit Gateway, VPC Endpoint, VPC Peering Connection or VPN Gateway. If the resource is in another account, you must specify an ARN.
   187  	Destination string `pulumi:"destination"`
   188  	// IP address of the destination resource.
   189  	DestinationIp *string `pulumi:"destinationIp"`
   190  	// Destination port to analyze access to.
   191  	DestinationPort *int `pulumi:"destinationPort"`
   192  	// Protocol to use for analysis. Valid options are `tcp` or `udp`.
   193  	//
   194  	// The following arguments are optional:
   195  	Protocol string `pulumi:"protocol"`
   196  	// ID or ARN of the resource which is the source of the path. Can be an Instance, Internet Gateway, Network Interface, Transit Gateway, VPC Endpoint, VPC Peering Connection or VPN Gateway. If the resource is in another account, you must specify an ARN.
   197  	Source string `pulumi:"source"`
   198  	// IP address of the source resource.
   199  	SourceIp *string `pulumi:"sourceIp"`
   200  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   201  	Tags map[string]string `pulumi:"tags"`
   202  }
   203  
   204  // The set of arguments for constructing a NetworkInsightsPath resource.
   205  type NetworkInsightsPathArgs struct {
   206  	// ID or ARN of the resource which is the destination of the path. Can be an Instance, Internet Gateway, Network Interface, Transit Gateway, VPC Endpoint, VPC Peering Connection or VPN Gateway. If the resource is in another account, you must specify an ARN.
   207  	Destination pulumi.StringInput
   208  	// IP address of the destination resource.
   209  	DestinationIp pulumi.StringPtrInput
   210  	// Destination port to analyze access to.
   211  	DestinationPort pulumi.IntPtrInput
   212  	// Protocol to use for analysis. Valid options are `tcp` or `udp`.
   213  	//
   214  	// The following arguments are optional:
   215  	Protocol pulumi.StringInput
   216  	// ID or ARN of the resource which is the source of the path. Can be an Instance, Internet Gateway, Network Interface, Transit Gateway, VPC Endpoint, VPC Peering Connection or VPN Gateway. If the resource is in another account, you must specify an ARN.
   217  	Source pulumi.StringInput
   218  	// IP address of the source resource.
   219  	SourceIp pulumi.StringPtrInput
   220  	// Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   221  	Tags pulumi.StringMapInput
   222  }
   223  
   224  func (NetworkInsightsPathArgs) ElementType() reflect.Type {
   225  	return reflect.TypeOf((*networkInsightsPathArgs)(nil)).Elem()
   226  }
   227  
   228  type NetworkInsightsPathInput interface {
   229  	pulumi.Input
   230  
   231  	ToNetworkInsightsPathOutput() NetworkInsightsPathOutput
   232  	ToNetworkInsightsPathOutputWithContext(ctx context.Context) NetworkInsightsPathOutput
   233  }
   234  
   235  func (*NetworkInsightsPath) ElementType() reflect.Type {
   236  	return reflect.TypeOf((**NetworkInsightsPath)(nil)).Elem()
   237  }
   238  
   239  func (i *NetworkInsightsPath) ToNetworkInsightsPathOutput() NetworkInsightsPathOutput {
   240  	return i.ToNetworkInsightsPathOutputWithContext(context.Background())
   241  }
   242  
   243  func (i *NetworkInsightsPath) ToNetworkInsightsPathOutputWithContext(ctx context.Context) NetworkInsightsPathOutput {
   244  	return pulumi.ToOutputWithContext(ctx, i).(NetworkInsightsPathOutput)
   245  }
   246  
   247  // NetworkInsightsPathArrayInput is an input type that accepts NetworkInsightsPathArray and NetworkInsightsPathArrayOutput values.
   248  // You can construct a concrete instance of `NetworkInsightsPathArrayInput` via:
   249  //
   250  //	NetworkInsightsPathArray{ NetworkInsightsPathArgs{...} }
   251  type NetworkInsightsPathArrayInput interface {
   252  	pulumi.Input
   253  
   254  	ToNetworkInsightsPathArrayOutput() NetworkInsightsPathArrayOutput
   255  	ToNetworkInsightsPathArrayOutputWithContext(context.Context) NetworkInsightsPathArrayOutput
   256  }
   257  
   258  type NetworkInsightsPathArray []NetworkInsightsPathInput
   259  
   260  func (NetworkInsightsPathArray) ElementType() reflect.Type {
   261  	return reflect.TypeOf((*[]*NetworkInsightsPath)(nil)).Elem()
   262  }
   263  
   264  func (i NetworkInsightsPathArray) ToNetworkInsightsPathArrayOutput() NetworkInsightsPathArrayOutput {
   265  	return i.ToNetworkInsightsPathArrayOutputWithContext(context.Background())
   266  }
   267  
   268  func (i NetworkInsightsPathArray) ToNetworkInsightsPathArrayOutputWithContext(ctx context.Context) NetworkInsightsPathArrayOutput {
   269  	return pulumi.ToOutputWithContext(ctx, i).(NetworkInsightsPathArrayOutput)
   270  }
   271  
   272  // NetworkInsightsPathMapInput is an input type that accepts NetworkInsightsPathMap and NetworkInsightsPathMapOutput values.
   273  // You can construct a concrete instance of `NetworkInsightsPathMapInput` via:
   274  //
   275  //	NetworkInsightsPathMap{ "key": NetworkInsightsPathArgs{...} }
   276  type NetworkInsightsPathMapInput interface {
   277  	pulumi.Input
   278  
   279  	ToNetworkInsightsPathMapOutput() NetworkInsightsPathMapOutput
   280  	ToNetworkInsightsPathMapOutputWithContext(context.Context) NetworkInsightsPathMapOutput
   281  }
   282  
   283  type NetworkInsightsPathMap map[string]NetworkInsightsPathInput
   284  
   285  func (NetworkInsightsPathMap) ElementType() reflect.Type {
   286  	return reflect.TypeOf((*map[string]*NetworkInsightsPath)(nil)).Elem()
   287  }
   288  
   289  func (i NetworkInsightsPathMap) ToNetworkInsightsPathMapOutput() NetworkInsightsPathMapOutput {
   290  	return i.ToNetworkInsightsPathMapOutputWithContext(context.Background())
   291  }
   292  
   293  func (i NetworkInsightsPathMap) ToNetworkInsightsPathMapOutputWithContext(ctx context.Context) NetworkInsightsPathMapOutput {
   294  	return pulumi.ToOutputWithContext(ctx, i).(NetworkInsightsPathMapOutput)
   295  }
   296  
   297  type NetworkInsightsPathOutput struct{ *pulumi.OutputState }
   298  
   299  func (NetworkInsightsPathOutput) ElementType() reflect.Type {
   300  	return reflect.TypeOf((**NetworkInsightsPath)(nil)).Elem()
   301  }
   302  
   303  func (o NetworkInsightsPathOutput) ToNetworkInsightsPathOutput() NetworkInsightsPathOutput {
   304  	return o
   305  }
   306  
   307  func (o NetworkInsightsPathOutput) ToNetworkInsightsPathOutputWithContext(ctx context.Context) NetworkInsightsPathOutput {
   308  	return o
   309  }
   310  
   311  // ARN of the Network Insights Path.
   312  func (o NetworkInsightsPathOutput) Arn() pulumi.StringOutput {
   313  	return o.ApplyT(func(v *NetworkInsightsPath) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   314  }
   315  
   316  // ID or ARN of the resource which is the destination of the path. Can be an Instance, Internet Gateway, Network Interface, Transit Gateway, VPC Endpoint, VPC Peering Connection or VPN Gateway. If the resource is in another account, you must specify an ARN.
   317  func (o NetworkInsightsPathOutput) Destination() pulumi.StringOutput {
   318  	return o.ApplyT(func(v *NetworkInsightsPath) pulumi.StringOutput { return v.Destination }).(pulumi.StringOutput)
   319  }
   320  
   321  // ARN of the destination.
   322  func (o NetworkInsightsPathOutput) DestinationArn() pulumi.StringOutput {
   323  	return o.ApplyT(func(v *NetworkInsightsPath) pulumi.StringOutput { return v.DestinationArn }).(pulumi.StringOutput)
   324  }
   325  
   326  // IP address of the destination resource.
   327  func (o NetworkInsightsPathOutput) DestinationIp() pulumi.StringPtrOutput {
   328  	return o.ApplyT(func(v *NetworkInsightsPath) pulumi.StringPtrOutput { return v.DestinationIp }).(pulumi.StringPtrOutput)
   329  }
   330  
   331  // Destination port to analyze access to.
   332  func (o NetworkInsightsPathOutput) DestinationPort() pulumi.IntPtrOutput {
   333  	return o.ApplyT(func(v *NetworkInsightsPath) pulumi.IntPtrOutput { return v.DestinationPort }).(pulumi.IntPtrOutput)
   334  }
   335  
   336  // Protocol to use for analysis. Valid options are `tcp` or `udp`.
   337  //
   338  // The following arguments are optional:
   339  func (o NetworkInsightsPathOutput) Protocol() pulumi.StringOutput {
   340  	return o.ApplyT(func(v *NetworkInsightsPath) pulumi.StringOutput { return v.Protocol }).(pulumi.StringOutput)
   341  }
   342  
   343  // ID or ARN of the resource which is the source of the path. Can be an Instance, Internet Gateway, Network Interface, Transit Gateway, VPC Endpoint, VPC Peering Connection or VPN Gateway. If the resource is in another account, you must specify an ARN.
   344  func (o NetworkInsightsPathOutput) Source() pulumi.StringOutput {
   345  	return o.ApplyT(func(v *NetworkInsightsPath) pulumi.StringOutput { return v.Source }).(pulumi.StringOutput)
   346  }
   347  
   348  // ARN of the source.
   349  func (o NetworkInsightsPathOutput) SourceArn() pulumi.StringOutput {
   350  	return o.ApplyT(func(v *NetworkInsightsPath) pulumi.StringOutput { return v.SourceArn }).(pulumi.StringOutput)
   351  }
   352  
   353  // IP address of the source resource.
   354  func (o NetworkInsightsPathOutput) SourceIp() pulumi.StringPtrOutput {
   355  	return o.ApplyT(func(v *NetworkInsightsPath) pulumi.StringPtrOutput { return v.SourceIp }).(pulumi.StringPtrOutput)
   356  }
   357  
   358  // Map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   359  func (o NetworkInsightsPathOutput) Tags() pulumi.StringMapOutput {
   360  	return o.ApplyT(func(v *NetworkInsightsPath) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   361  }
   362  
   363  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   364  //
   365  // Deprecated: Please use `tags` instead.
   366  func (o NetworkInsightsPathOutput) TagsAll() pulumi.StringMapOutput {
   367  	return o.ApplyT(func(v *NetworkInsightsPath) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   368  }
   369  
   370  type NetworkInsightsPathArrayOutput struct{ *pulumi.OutputState }
   371  
   372  func (NetworkInsightsPathArrayOutput) ElementType() reflect.Type {
   373  	return reflect.TypeOf((*[]*NetworkInsightsPath)(nil)).Elem()
   374  }
   375  
   376  func (o NetworkInsightsPathArrayOutput) ToNetworkInsightsPathArrayOutput() NetworkInsightsPathArrayOutput {
   377  	return o
   378  }
   379  
   380  func (o NetworkInsightsPathArrayOutput) ToNetworkInsightsPathArrayOutputWithContext(ctx context.Context) NetworkInsightsPathArrayOutput {
   381  	return o
   382  }
   383  
   384  func (o NetworkInsightsPathArrayOutput) Index(i pulumi.IntInput) NetworkInsightsPathOutput {
   385  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *NetworkInsightsPath {
   386  		return vs[0].([]*NetworkInsightsPath)[vs[1].(int)]
   387  	}).(NetworkInsightsPathOutput)
   388  }
   389  
   390  type NetworkInsightsPathMapOutput struct{ *pulumi.OutputState }
   391  
   392  func (NetworkInsightsPathMapOutput) ElementType() reflect.Type {
   393  	return reflect.TypeOf((*map[string]*NetworkInsightsPath)(nil)).Elem()
   394  }
   395  
   396  func (o NetworkInsightsPathMapOutput) ToNetworkInsightsPathMapOutput() NetworkInsightsPathMapOutput {
   397  	return o
   398  }
   399  
   400  func (o NetworkInsightsPathMapOutput) ToNetworkInsightsPathMapOutputWithContext(ctx context.Context) NetworkInsightsPathMapOutput {
   401  	return o
   402  }
   403  
   404  func (o NetworkInsightsPathMapOutput) MapIndex(k pulumi.StringInput) NetworkInsightsPathOutput {
   405  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *NetworkInsightsPath {
   406  		return vs[0].(map[string]*NetworkInsightsPath)[vs[1].(string)]
   407  	}).(NetworkInsightsPathOutput)
   408  }
   409  
   410  func init() {
   411  	pulumi.RegisterInputType(reflect.TypeOf((*NetworkInsightsPathInput)(nil)).Elem(), &NetworkInsightsPath{})
   412  	pulumi.RegisterInputType(reflect.TypeOf((*NetworkInsightsPathArrayInput)(nil)).Elem(), NetworkInsightsPathArray{})
   413  	pulumi.RegisterInputType(reflect.TypeOf((*NetworkInsightsPathMapInput)(nil)).Elem(), NetworkInsightsPathMap{})
   414  	pulumi.RegisterOutputType(NetworkInsightsPathOutput{})
   415  	pulumi.RegisterOutputType(NetworkInsightsPathArrayOutput{})
   416  	pulumi.RegisterOutputType(NetworkInsightsPathMapOutput{})
   417  }