Skip to content

resize_cluster

resize_cluster(
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    cluster_identifier: Optional[String] = None,
    cluster_type: Optional[String] = None,
    node_type: Optional[String] = None,
    number_of_nodes: Optional[IntegerOptional] = None,
    classic: Optional[BooleanOptional] = None,
    reserved_node_id: Optional[String] = None,
    target_reserved_node_offering_id: Optional[String] = None,
) -> ResizeClusterResult

Changes the size of the cluster. You can change the cluster's type, or change the number or type of nodes. The default behavior is to use the elastic resize method. With an elastic resize, your cluster is available for read and write operations more quickly than with the classic resize method.

Elastic resize operations have the following restrictions:

  • You can only resize clusters of the following types:

    • dc2.large

    • dc2.8xlarge

    • rg.large

    • rg.xlarge

    • rg.4xlarge

    • rg.12xlarge

    • ra3.large

    • ra3.xlplus

    • ra3.4xlarge

    • ra3.16xlarge

  • The type of nodes that you add must match the node type for the cluster.

Parameters:

  • cluster_identifier (Optional[String], default: None ) –

    The unique identifier for the cluster to resize.

  • cluster_type (Optional[String], default: None ) –

    The new cluster type for the specified cluster.

  • node_type (Optional[String], default: None ) –

    The new node type for the nodes you are adding. If not specified, the cluster's current node type is used.

  • number_of_nodes (Optional[IntegerOptional], default: None ) –

    The new number of nodes for the cluster. If not specified, the cluster's current number of nodes is used.

  • classic (Optional[BooleanOptional], default: None ) –

    A boolean value indicating whether the resize operation is using the classic resize process. If you don't provide this parameter or set the value to false, the resize type is elastic.

  • reserved_node_id (Optional[String], default: None ) –

    The identifier of the reserved node.

  • target_reserved_node_offering_id (Optional[String], default: None ) –

    The identifier of the target reserved node offering.

Raises:

Source code in docs_src/capo_redshift/_services/redshift.py
def resize_cluster(
    self,
    *,
    config_overrides: Optional[RedshiftClientConfig] = None,
    cluster_identifier: Optional["capo_redshift.types.string.String"] = None,
    cluster_type: Optional["capo_redshift.types.string.String"] = None,
    node_type: Optional["capo_redshift.types.string.String"] = None,
    number_of_nodes: Optional[
        "capo_redshift.types.integer_optional.IntegerOptional"
    ] = None,
    classic: Optional[
        "capo_redshift.types.boolean_optional.BooleanOptional"
    ] = None,
    reserved_node_id: Optional["capo_redshift.types.string.String"] = None,
    target_reserved_node_offering_id: Optional[
        "capo_redshift.types.string.String"
    ] = None,
) -> "capo_redshift.types.resize_cluster_result.ResizeClusterResult":
    """<p>Changes the size of the cluster. You can change the cluster's type, or change the number or type of nodes. The default behavior is to use the elastic resize method. With an elastic resize, your cluster is available for read and write operations more quickly than with the classic resize method. </p> <p>Elastic resize operations have the following restrictions:</p> <ul> <li> <p>You can only resize clusters of the following types:</p> <ul> <li> <p>dc2.large</p> </li> <li> <p>dc2.8xlarge</p> </li> <li> <p>rg.large</p> </li> <li> <p>rg.xlarge</p> </li> <li> <p>rg.4xlarge</p> </li> <li> <p>rg.12xlarge</p> </li> <li> <p>ra3.large</p> </li> <li> <p>ra3.xlplus</p> </li> <li> <p>ra3.4xlarge</p> </li> <li> <p>ra3.16xlarge</p> </li> </ul> </li> <li> <p>The type of nodes that you add must match the node type for the cluster.</p> </li> </ul>

    Args:
        cluster_identifier: <p>The unique identifier for the cluster to resize.</p>
        cluster_type: <p>The new cluster type for the specified cluster.</p>
        node_type: <p>The new node type for the nodes you are adding. If not specified, the cluster's current node type is used.</p>
        number_of_nodes: <p>The new number of nodes for the cluster. If not specified, the cluster's current number of nodes is used.</p>
        classic: <p>A boolean value indicating whether the resize operation is using the classic resize process. If you don't provide this parameter or set the value to <code>false</code>, the resize type is elastic. </p>
        reserved_node_id: <p>The identifier of the reserved node.</p>
        target_reserved_node_offering_id: <p>The identifier of the target reserved node offering.</p>

    Raises:
        capo_redshift.errors.cluster_not_found_fault.ClusterNotFoundFault: <p>The <code>ClusterIdentifier</code> parameter does not refer to an existing cluster. </p>
        capo_redshift.errors.dependent_service_unavailable_fault.DependentServiceUnavailableFault: <p>Your request cannot be completed because a dependent internal service is temporarily unavailable. Wait 30 to 60 seconds and try again.</p>
        capo_redshift.errors.insufficient_cluster_capacity_fault.InsufficientClusterCapacityFault: <p>The number of nodes specified exceeds the allotted capacity of the cluster.</p>
        capo_redshift.errors.invalid_cluster_state_fault.InvalidClusterStateFault: <p>The specified cluster is not in the <code>available</code> state. </p>
        capo_redshift.errors.invalid_reserved_node_state_fault.InvalidReservedNodeStateFault: <p>Indicates that the Reserved Node being exchanged is not in an active state.</p>
        capo_redshift.errors.limit_exceeded_fault.LimitExceededFault: <p>The encryption key has exceeded its grant limit in Amazon Web Services KMS.</p>
        capo_redshift.errors.number_of_nodes_per_cluster_limit_exceeded_fault.NumberOfNodesPerClusterLimitExceededFault: <p>The operation would exceed the number of nodes allowed for a cluster.</p>
        capo_redshift.errors.number_of_nodes_quota_exceeded_fault.NumberOfNodesQuotaExceededFault: <p>The operation would exceed the number of nodes allotted to the account. For information about increasing your quota, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html">Limits in Amazon Redshift</a> in the <i>Amazon Redshift Cluster Management Guide</i>. </p>
        capo_redshift.errors.reserved_node_already_exists_fault.ReservedNodeAlreadyExistsFault: <p>User already has a reservation with the given identifier.</p>
        capo_redshift.errors.reserved_node_already_migrated_fault.ReservedNodeAlreadyMigratedFault: <p>Indicates that the reserved node has already been exchanged.</p>
        capo_redshift.errors.reserved_node_not_found_fault.ReservedNodeNotFoundFault: <p>The specified reserved compute node not found.</p>
        capo_redshift.errors.reserved_node_offering_not_found_fault.ReservedNodeOfferingNotFoundFault: <p>Specified offering does not exist.</p>
        capo_redshift.errors.unauthorized_operation.UnauthorizedOperation: <p>Your account is not authorized to perform the requested operation.</p>
        capo_redshift.errors.unsupported_operation_fault.UnsupportedOperationFault: <p>The requested operation isn't supported.</p>
        capo_redshift.errors.unsupported_option_fault.UnsupportedOptionFault: <p>A request option was specified that is not supported.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_redshift.types.resize_cluster_message.ResizeClusterMessage]",
    ) -> OperationResponse[
        "capo_redshift.types.resize_cluster_result.ResizeClusterResult"
    ]:
        import capo_redshift._operations.redshift_service_version20121201.resize_cluster

        output, http_response = (
            capo_redshift._operations.redshift_service_version20121201.resize_cluster.resize_cluster(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_redshift.types.resize_cluster_result.ResizeClusterResult",
    ) -> dict[str, Any]:
        import capo_redshift.types.resize_cluster_result

        return capo_redshift.types.resize_cluster_result.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ResizeCluster", redact_output=_redact_output),
    )
    input_: capo_redshift.types.resize_cluster_message.ResizeClusterMessage = {}
    if cluster_identifier is not None:
        input_["cluster_identifier"] = cluster_identifier
    if cluster_type is not None:
        input_["cluster_type"] = cluster_type
    if node_type is not None:
        input_["node_type"] = node_type
    if number_of_nodes is not None:
        input_["number_of_nodes"] = number_of_nodes
    if classic is not None:
        input_["classic"] = classic
    if reserved_node_id is not None:
        input_["reserved_node_id"] = reserved_node_id
    if target_reserved_node_offering_id is not None:
        input_["target_reserved_node_offering_id"] = (
            target_reserved_node_offering_id
        )

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output