:doc:`EC2 <../../ec2>` / Client / modify_traffic_mirror_filter_rule

*********************************
modify_traffic_mirror_filter_rule
*********************************



.. py:method:: EC2.Client.modify_traffic_mirror_filter_rule(**kwargs)

  

  Modifies the specified Traffic Mirror rule.

   

  ``DestinationCidrBlock`` and ``SourceCidrBlock`` must both be an IPv4 range or an IPv6 range.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorFilterRule>`_  


  **Request Syntax**
  ::

    response = client.modify_traffic_mirror_filter_rule(
        TrafficMirrorFilterRuleId='string',
        TrafficDirection='ingress'|'egress',
        RuleNumber=123,
        RuleAction='accept'|'reject',
        DestinationPortRange={
            'FromPort': 123,
            'ToPort': 123
        },
        SourcePortRange={
            'FromPort': 123,
            'ToPort': 123
        },
        Protocol=123,
        DestinationCidrBlock='string',
        SourceCidrBlock='string',
        Description='string',
        RemoveFields=[
            'destination-port-range'|'source-port-range'|'protocol'|'description',
        ],
        DryRun=True|False
    )
    
  :type TrafficMirrorFilterRuleId: string
  :param TrafficMirrorFilterRuleId: **[REQUIRED]** 

    The ID of the Traffic Mirror rule.

    

  
  :type TrafficDirection: string
  :param TrafficDirection: 

    The type of traffic to assign to the rule.

    

  
  :type RuleNumber: integer
  :param RuleNumber: 

    The number of the Traffic Mirror rule. This number must be unique for each Traffic Mirror rule in a given direction. The rules are processed in ascending order by rule number.

    

  
  :type RuleAction: string
  :param RuleAction: 

    The action to assign to the rule.

    

  
  :type DestinationPortRange: dict
  :param DestinationPortRange: 

    The destination ports that are associated with the Traffic Mirror rule.

    

  
    - **FromPort** *(integer) --* 

      The first port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.

      

    
    - **ToPort** *(integer) --* 

      The last port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.

      

    
  
  :type SourcePortRange: dict
  :param SourcePortRange: 

    The port range to assign to the Traffic Mirror rule.

    

  
    - **FromPort** *(integer) --* 

      The first port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.

      

    
    - **ToPort** *(integer) --* 

      The last port in the Traffic Mirror port range. This applies to the TCP and UDP protocols.

      

    
  
  :type Protocol: integer
  :param Protocol: 

    The protocol, for example TCP, to assign to the Traffic Mirror rule.

    

  
  :type DestinationCidrBlock: string
  :param DestinationCidrBlock: 

    The destination CIDR block to assign to the Traffic Mirror rule.

    

  
  :type SourceCidrBlock: string
  :param SourceCidrBlock: 

    The source CIDR block to assign to the Traffic Mirror rule.

    

  
  :type Description: string
  :param Description: 

    The description to assign to the Traffic Mirror rule.

    

  
  :type RemoveFields: list
  :param RemoveFields: 

    The properties that you want to remove from the Traffic Mirror filter rule.

     

    When you remove a property from a Traffic Mirror filter rule, the property is set to the default.

    

  
    - *(string) --* 

    

  :type DryRun: boolean
  :param DryRun: 

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is ``DryRunOperation``. Otherwise, it is ``UnauthorizedOperation``.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'TrafficMirrorFilterRule': {
              'TrafficMirrorFilterRuleId': 'string',
              'TrafficMirrorFilterId': 'string',
              'TrafficDirection': 'ingress'|'egress',
              'RuleNumber': 123,
              'RuleAction': 'accept'|'reject',
              'Protocol': 123,
              'DestinationPortRange': {
                  'FromPort': 123,
                  'ToPort': 123
              },
              'SourcePortRange': {
                  'FromPort': 123,
                  'ToPort': 123
              },
              'DestinationCidrBlock': 'string',
              'SourceCidrBlock': 'string',
              'Description': 'string',
              'Tags': [
                  {
                      'Key': 'string',
                      'Value': 'string'
                  },
              ]
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **TrafficMirrorFilterRule** *(dict) --* 

        .. note::

          

          Tags are not returned for ModifyTrafficMirrorFilterRule.

          

         

        A Traffic Mirror rule.

        
        

        - **TrafficMirrorFilterRuleId** *(string) --* 

          The ID of the Traffic Mirror rule.

          
        

        - **TrafficMirrorFilterId** *(string) --* 

          The ID of the Traffic Mirror filter that the rule is associated with.

          
        

        - **TrafficDirection** *(string) --* 

          The traffic direction assigned to the Traffic Mirror rule.

          
        

        - **RuleNumber** *(integer) --* 

          The rule number of the Traffic Mirror rule.

          
        

        - **RuleAction** *(string) --* 

          The action assigned to the Traffic Mirror rule.

          
        

        - **Protocol** *(integer) --* 

          The protocol assigned to the Traffic Mirror rule.

          
        

        - **DestinationPortRange** *(dict) --* 

          The destination port range assigned to the Traffic Mirror rule.

          
          

          - **FromPort** *(integer) --* 

            The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.

            
          

          - **ToPort** *(integer) --* 

            The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.

            
      
        

        - **SourcePortRange** *(dict) --* 

          The source port range assigned to the Traffic Mirror rule.

          
          

          - **FromPort** *(integer) --* 

            The start of the Traffic Mirror port range. This applies to the TCP and UDP protocols.

            
          

          - **ToPort** *(integer) --* 

            The end of the Traffic Mirror port range. This applies to the TCP and UDP protocols.

            
      
        

        - **DestinationCidrBlock** *(string) --* 

          The destination CIDR block assigned to the Traffic Mirror rule.

          
        

        - **SourceCidrBlock** *(string) --* 

          The source CIDR block assigned to the Traffic Mirror rule.

          
        

        - **Description** *(string) --* 

          The description of the Traffic Mirror rule.

          
        

        - **Tags** *(list) --* 

          Tags on Traffic Mirroring filter rules.

          
          

          - *(dict) --* 

            Describes a tag.

            
            

            - **Key** *(string) --* 

              The key of the tag.

               

              Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with ``aws:``.

              
            

            - **Value** *(string) --* 

              The value of the tag.

               

              Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.

              
        
      
    
  