Scalr\Service\Aws\Ec2\V20140615\Ec2Api::associateRouteTable PHP Метод

associateRouteTable() публичный Метод

Associates a subnet with a route table. The subnet and route table must be in the same VPC. This association causes traffic originating from the subnet to be routed according to the routes in the route table. The action returns an association ID, which you need if you want to disassociate the route table from the subnet later. A route table can be associated with multiple subnets.
public associateRouteTable ( string $routeTableId, string $subnetId ) : string
$routeTableId string The ID of the Route Table.
$subnetId string The ID of the subnet.
Результат string Returns the ID of the association on success
    public function associateRouteTable($routeTableId, $subnetId)
    {
        $result = null;
        $options = array('RouteTableId' => (string) $routeTableId, 'SubnetId' => (string) $subnetId);
        $action = ucfirst(__FUNCTION__);
        $response = $this->client->call($action, $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            $result = (string) $sxml->associationId;
        }
        return $result;
    }
Ec2Api