Class TrafficMirrorSession


  • public class TrafficMirrorSession
    extends com.pulumi.resources.CustomResource
    Provides an Traffic mirror session.\ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirroring/traffic-mirroring-considerations.html) for traffic mirroring ## Example Usage To create a basic traffic mirror session
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.ec2.TrafficMirrorFilter;
     import com.pulumi.aws.ec2.TrafficMirrorFilterArgs;
     import com.pulumi.aws.ec2.TrafficMirrorTarget;
     import com.pulumi.aws.ec2.TrafficMirrorTargetArgs;
     import com.pulumi.aws.ec2.TrafficMirrorSession;
     import com.pulumi.aws.ec2.TrafficMirrorSessionArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var filter = new TrafficMirrorFilter("filter", TrafficMirrorFilterArgs.builder()
                 .description("traffic mirror filter - example")
                 .networkServices("amazon-dns")
                 .build());
     
             var target = new TrafficMirrorTarget("target", TrafficMirrorTargetArgs.builder()
                 .networkLoadBalancerArn(lb.arn())
                 .build());
     
             var session = new TrafficMirrorSession("session", TrafficMirrorSessionArgs.builder()
                 .description("traffic mirror session - example")
                 .networkInterfaceId(test.primaryNetworkInterfaceId())
                 .sessionNumber(1)
                 .trafficMirrorFilterId(filter.id())
                 .trafficMirrorTargetId(target.id())
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import traffic mirror sessions using the `id`. For example: ```sh $ pulumi import aws:ec2/trafficMirrorSession:TrafficMirrorSession session tms-0d8aa3ca35897b82e ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      static TrafficMirrorSession get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, TrafficMirrorSessionState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> networkInterfaceId()  
      com.pulumi.core.Output<java.lang.String> ownerId()  
      com.pulumi.core.Output<java.lang.Integer> packetLength()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.Integer> sessionNumber()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.lang.String> trafficMirrorFilterId()  
      com.pulumi.core.Output<java.lang.String> trafficMirrorTargetId()  
      com.pulumi.core.Output<java.lang.Integer> virtualNetworkId()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TrafficMirrorSession

        public TrafficMirrorSession​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • TrafficMirrorSession

        public TrafficMirrorSession​(java.lang.String name,
                                    TrafficMirrorSessionArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • TrafficMirrorSession

        public TrafficMirrorSession​(java.lang.String name,
                                    TrafficMirrorSessionArgs args,
                                    @Nullable
                                    com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        The ARN of the traffic mirror session.
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        A description of the traffic mirror session.
      • networkInterfaceId

        public com.pulumi.core.Output<java.lang.String> networkInterfaceId()
        Returns:
        ID of the source network interface. Not all network interfaces are eligible as mirror sources. On EC2 instances only nitro based instances support mirroring.
      • ownerId

        public com.pulumi.core.Output<java.lang.String> ownerId()
        Returns:
        The AWS account ID of the session owner.
      • packetLength

        public com.pulumi.core.Output<java.lang.Integer> packetLength()
        Returns:
        The number of bytes in each packet to mirror. These are bytes after the VXLAN header. Do not specify this parameter when you want to mirror the entire packet. To mirror a subset of the packet, set this to the length (in bytes) that you want to mirror.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • sessionNumber

        public com.pulumi.core.Output<java.lang.Integer> sessionNumber()
        Returns:
        The session number determines the order in which sessions are evaluated when an interface is used by multiple sessions. The first session with a matching filter is the one that mirrors the packets.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Key-value map of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • trafficMirrorFilterId

        public com.pulumi.core.Output<java.lang.String> trafficMirrorFilterId()
        Returns:
        ID of the traffic mirror filter to be used
      • trafficMirrorTargetId

        public com.pulumi.core.Output<java.lang.String> trafficMirrorTargetId()
        Returns:
        ID of the traffic mirror target to be used
      • virtualNetworkId

        public com.pulumi.core.Output<java.lang.Integer> virtualNetworkId()
        Returns:
        The VXLAN ID for the Traffic Mirror session. For more information about the VXLAN protocol, see RFC 7348. If you do not specify a VirtualNetworkId, an account-wide unique ID is chosen at random.
      • get

        public static TrafficMirrorSession get​(java.lang.String name,
                                               com.pulumi.core.Output<java.lang.String> id,
                                               @Nullable
                                               TrafficMirrorSessionState state,
                                               @Nullable
                                               com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.