'Replaces an existing route within a route table in a VPC.
:type route_table_id: str
:param route_table_id: The ID of the route table for the route.
:type destination_cidr_block: str
:param destination_cidr_block: The CIDR address block used for the
destination match.
:type gateway_id: str
:param gateway_id: The ID of the gateway attached to your VPC.
:type instance_id: str
:param instance_id: The ID of a NAT instance in your VPC.
:type interface_id: str
:param interface_id: Allows routing to network interface attachments.
:type vpc_peering_connection_id: str
:param vpc_peering_connection_id: Allows routing to VPC peering
connection.
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
:rtype: bool
:return: True if successful'

def replace_route(self, route_table_id, destination_cidr_block, gateway_id=None, instance_id=None, interface_id=None, vpc_peering_connection_id=None, dry_run=False):

    params = {'RouteTableId': route_table_id, 'DestinationCidrBlock': destination_cidr_block}
    if (gateway_id is not None):
        params['GatewayId'] = gateway_id
    elif (instance_id is not None):
        params['InstanceId'] = instance_id
    elif (interface_id is not None):
        params['NetworkInterfaceId'] = interface_id
    elif (vpc_peering_connection_id is not None):
        params['VpcPeeringConnectionId'] = vpc_peering_connection_id
    if dry_run:
        params['DryRun'] = 'true'
    return self.get_status('ReplaceRoute', params)
