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

*****************************
replace_transit_gateway_route
*****************************



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

  

  Replaces the specified route in the specified transit gateway route table.

  

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


  **Request Syntax**
  ::

    response = client.replace_transit_gateway_route(
        DestinationCidrBlock='string',
        TransitGatewayRouteTableId='string',
        TransitGatewayAttachmentId='string',
        Blackhole=True|False,
        DryRun=True|False
    )
    
  :type DestinationCidrBlock: string
  :param DestinationCidrBlock: **[REQUIRED]** 

    The CIDR range used for the destination match. Routing decisions are based on the most specific match.

    

  
  :type TransitGatewayRouteTableId: string
  :param TransitGatewayRouteTableId: **[REQUIRED]** 

    The ID of the route table.

    

  
  :type TransitGatewayAttachmentId: string
  :param TransitGatewayAttachmentId: 

    The ID of the attachment.

    

  
  :type Blackhole: boolean
  :param Blackhole: 

    Indicates whether traffic matching this route is to be dropped.

    

  
  :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**

    
    ::

      {
          'Route': {
              'DestinationCidrBlock': 'string',
              'PrefixListId': 'string',
              'TransitGatewayRouteTableAnnouncementId': 'string',
              'TransitGatewayAttachments': [
                  {
                      'ResourceId': 'string',
                      'TransitGatewayAttachmentId': 'string',
                      'ResourceType': 'vpc'|'vpn'|'vpn-concentrator'|'direct-connect-gateway'|'connect'|'peering'|'tgw-peering'|'network-function'
                  },
              ],
              'Type': 'static'|'propagated',
              'State': 'pending'|'active'|'blackhole'|'deleting'|'deleted'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Route** *(dict) --* 

        Information about the modified route.

        
        

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

          The CIDR block used for destination matches.

          
        

        - **PrefixListId** *(string) --* 

          The ID of the prefix list used for destination matches.

          
        

        - **TransitGatewayRouteTableAnnouncementId** *(string) --* 

          The ID of the transit gateway route table announcement.

          
        

        - **TransitGatewayAttachments** *(list) --* 

          The attachments.

          
          

          - *(dict) --* 

            Describes a route attachment.

            
            

            - **ResourceId** *(string) --* 

              The ID of the resource.

              
            

            - **TransitGatewayAttachmentId** *(string) --* 

              The ID of the attachment.

              
            

            - **ResourceType** *(string) --* 

              The resource type. Note that the ``tgw-peering`` resource type has been deprecated.

              
        
      
        

        - **Type** *(string) --* 

          The route type.

          
        

        - **State** *(string) --* 

          The state of the route.

          
    
  