Skip to content

increase_replica_count

increase_replica_count(
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    replication_group_id: Optional[String] = None,
    new_replica_count: Optional[IntegerOptional] = None,
    replica_configuration: Optional[ReplicaConfigurationList] = None,
    apply_immediately: Optional[Boolean] = None,
) -> IncreaseReplicaCountResult

Dynamically increases the number of replicas in a Valkey or Redis OSS (cluster mode disabled) replication group or the number of replica nodes in one or more node groups (shards) of a Valkey or Redis OSS (cluster mode enabled) replication group. This operation is performed with no cluster down time.

Parameters:

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

    The id of the replication group to which you want to add replica nodes.

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

    The number of read replica nodes you want at the completion of this operation. For Valkey or Redis OSS (cluster mode disabled) replication groups, this is the number of replica nodes in the replication group. For Valkey or Redis OSS (cluster mode enabled) replication groups, this is the number of replica nodes in each of the replication group's node groups.

  • replica_configuration (Optional[ReplicaConfigurationList], default: None ) –

    A list of ConfigureShard objects that can be used to configure each shard in a Valkey or Redis OSS (cluster mode enabled) replication group. The ConfigureShard has three members: NewReplicaCount, NodeGroupId, and PreferredAvailabilityZones.

  • apply_immediately (Optional[Boolean], default: None ) –

    If True, the number of replica nodes is increased immediately. ApplyImmediately=False is not currently supported.

Raises:

Source code in docs_src/capo_elasticache/_services/elasti_cache.py
def increase_replica_count(
    self,
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    replication_group_id: Optional["capo_elasticache.types.string.String"] = None,
    new_replica_count: Optional[
        "capo_elasticache.types.integer_optional.IntegerOptional"
    ] = None,
    replica_configuration: Optional[
        "capo_elasticache.types.replica_configuration_list.ReplicaConfigurationList"
    ] = None,
    apply_immediately: Optional["capo_elasticache.types.boolean.Boolean"] = None,
) -> "capo_elasticache.types.increase_replica_count_result.IncreaseReplicaCountResult":
    """<p>Dynamically increases the number of replicas in a Valkey or Redis OSS (cluster mode disabled) replication group or the number of replica nodes in one or more node groups (shards) of a Valkey or Redis OSS (cluster mode enabled) replication group. This operation is performed with no cluster down time.</p>

    Args:
        replication_group_id: <p>The id of the replication group to which you want to add replica nodes.</p>
        new_replica_count: <p>The number of read replica nodes you want at the completion of this operation. For Valkey or Redis OSS (cluster mode disabled) replication groups, this is the number of replica nodes in the replication group. For Valkey or Redis OSS (cluster mode enabled) replication groups, this is the number of replica nodes in each of the replication group's node groups.</p>
        replica_configuration: <p>A list of <code>ConfigureShard</code> objects that can be used to configure each shard in a Valkey or Redis OSS (cluster mode enabled) replication group. The <code>ConfigureShard</code> has three members: <code>NewReplicaCount</code>, <code>NodeGroupId</code>, and <code>PreferredAvailabilityZones</code>.</p>
        apply_immediately: <p>If <code>True</code>, the number of replica nodes is increased immediately. <code>ApplyImmediately=False</code> is not currently supported.</p>

    Raises:
        capo_elasticache.errors.cluster_quota_for_customer_exceeded_fault.ClusterQuotaForCustomerExceededFault: <p>The request cannot be processed because it would exceed the allowed number of clusters per customer.</p>
        capo_elasticache.errors.insufficient_cache_cluster_capacity_fault.InsufficientCacheClusterCapacityFault: <p>The requested cache node type is not available in the specified Availability Zone. For more information, see <a href="http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/ErrorMessages.html#ErrorMessages.INSUFFICIENT_CACHE_CLUSTER_CAPACITY">InsufficientCacheClusterCapacity</a> in the ElastiCache User Guide.</p>
        capo_elasticache.errors.invalid_cache_cluster_state_fault.InvalidCacheClusterStateFault: <p>The requested cluster is not in the <code>available</code> state.</p>
        capo_elasticache.errors.invalid_kms_key_fault.InvalidKMSKeyFault: <p>The KMS key supplied is not valid.</p>
        capo_elasticache.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>Two or more incompatible parameters were specified.</p>
        capo_elasticache.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value for a parameter is invalid.</p>
        capo_elasticache.errors.invalid_replication_group_state_fault.InvalidReplicationGroupStateFault: <p>The requested replication group is not in the <code>available</code> state.</p>
        capo_elasticache.errors.invalid_vpc_network_state_fault.InvalidVPCNetworkStateFault: <p>The VPC network is in an invalid state.</p>
        capo_elasticache.errors.node_groups_per_replication_group_quota_exceeded_fault.NodeGroupsPerReplicationGroupQuotaExceededFault: <p>The request cannot be processed because it would exceed the maximum allowed number of node groups (shards) in a single replication group. The default maximum is 90</p>
        capo_elasticache.errors.node_quota_for_customer_exceeded_fault.NodeQuotaForCustomerExceededFault: <p>The request cannot be processed because it would exceed the allowed number of cache nodes per customer.</p>
        capo_elasticache.errors.no_operation_fault.NoOperationFault: <p>The operation was not performed because no changes were required.</p>
        capo_elasticache.errors.replication_group_not_found_fault.ReplicationGroupNotFoundFault: <p>The specified replication group does not exist.</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_elasticache.types.increase_replica_count_message.IncreaseReplicaCountMessage]",
    ) -> OperationResponse[
        "capo_elasticache.types.increase_replica_count_result.IncreaseReplicaCountResult"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.increase_replica_count

        output, http_response = (
            capo_elasticache._operations.amazon_elasti_cache_v9.increase_replica_count.increase_replica_count(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("IncreaseReplicaCount")
    )
    input_: capo_elasticache.types.increase_replica_count_message.IncreaseReplicaCountMessage = {}
    if replication_group_id is not None:
        input_["replication_group_id"] = replication_group_id
    if new_replica_count is not None:
        input_["new_replica_count"] = new_replica_count
    if replica_configuration is not None:
        input_["replica_configuration"] = replica_configuration
    if apply_immediately is not None:
        input_["apply_immediately"] = apply_immediately

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