Scalr\Service\Aws\Ec2\V20140615\Ec2Api::replaceRouteTableAssociation PHP Method

replaceRouteTableAssociation() public method

Changes the route table associated with a given subnet in a VPC. After you execute this action, the subnet uses the routes in the new route table it's associated with. You can also use this action to change which table is the main route table in the VPC. You just specify the main route table's association ID and the route table that you want to be the new main route table.
public replaceRouteTableAssociation ( string $routeTableId, string $associationId ) : string
$routeTableId string The ID of the new route table to associate with the subnet.
$associationId string The ID representing the current association between the original route table and the subnet.
return string Returns the ID of the new association on success
    public function replaceRouteTableAssociation($routeTableId, $associationId)
    {
        $result = false;
        $options = array('AssociationId' => (string) $associationId, 'RouteTableId' => (string) $routeTableId);
        $action = ucfirst(__FUNCTION__);
        $response = $this->client->call($action, $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            $result = (string) $sxml->newAssociationId;
        }
        return $result;
    }
Ec2Api