Skip to content

update_cluster

update_cluster(
    cluster_name: String,
    *,
    config_overrides: Optional[MemoryDBClientConfig] = None,
    description: Optional[String] = None,
    security_group_ids: Optional[SecurityGroupIdsList] = None,
    maintenance_window: Optional[String] = None,
    sns_topic_arn: Optional[String] = None,
    sns_topic_status: Optional[String] = None,
    parameter_group_name: Optional[String] = None,
    snapshot_window: Optional[String] = None,
    snapshot_retention_limit: Optional[IntegerOptional] = None,
    node_type: Optional[String] = None,
    engine: Optional[String] = None,
    engine_version: Optional[String] = None,
    replica_configuration: Optional[ReplicaConfigurationRequest] = None,
    shard_configuration: Optional[ShardConfigurationRequest] = None,
    acl_name: Optional[ACLName] = None,
    ip_discovery: Optional[IpDiscovery] = None,
) -> UpdateClusterResponse

Modifies the settings for a cluster. You can use this operation to change one or more cluster configuration settings by specifying the settings and the new values.

Parameters:

  • cluster_name (String) –

    The name of the cluster to update.

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

    The description of the cluster to update.

  • security_group_ids (Optional[SecurityGroupIdsList], default: None ) –

    The SecurityGroupIds to update.

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

    Specifies the weekly time range during which maintenance on the cluster is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period.

    Valid values for ddd are:

    • sun

    • mon

    • tue

    • wed

    • thu

    • fri

    • sat

    Example: sun:23:00-mon:01:30

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

    The SNS topic ARN to update.

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

    The status of the Amazon SNS notification topic. Notifications are sent only if the status is active.

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

    The name of the parameter group to update.

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

    The daily time range (in UTC) during which MemoryDB begins taking a daily snapshot of your cluster.

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

    The number of days for which MemoryDB retains automatic cluster snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is retained for 5 days before being deleted.

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

    A valid node type that you want to scale this cluster up or down to.

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

    The name of the engine to be used for the cluster.

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

    The upgraded version of the engine to be run on the nodes. You can upgrade to a newer engine version, but you cannot downgrade to an earlier engine version. If you want to use an earlier engine version, you must delete the existing cluster and create it anew with the earlier engine version.

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

    The number of replicas that will reside in each shard.

  • shard_configuration (Optional[ShardConfigurationRequest], default: None ) –

    The number of shards in the cluster.

  • acl_name (Optional[ACLName], default: None ) –

    The Access Control List that is associated with the cluster.

  • ip_discovery (Optional[IpDiscovery], default: None ) –

    The mechanism for discovering IP addresses for the cluster discovery protocol. Valid values are 'ipv4' or 'ipv6'. When set to 'ipv4', cluster discovery functions such as cluster slots, cluster shards, and cluster nodes will return IPv4 addresses for cluster nodes. When set to 'ipv6', the cluster discovery functions return IPv6 addresses for cluster nodes. The value must be compatible with the NetworkType parameter. If not specified, the default is 'ipv4'.

Raises:

Source code in docs_src/capo_memorydb/_services/memory_db.py
def update_cluster(
    self,
    cluster_name: "capo_memorydb.types.string.String",
    *,
    config_overrides: Optional[MemoryDBClientConfig] = None,
    description: Optional["capo_memorydb.types.string.String"] = None,
    security_group_ids: Optional[
        "capo_memorydb.types.security_group_ids_list.SecurityGroupIdsList"
    ] = None,
    maintenance_window: Optional["capo_memorydb.types.string.String"] = None,
    sns_topic_arn: Optional["capo_memorydb.types.string.String"] = None,
    sns_topic_status: Optional["capo_memorydb.types.string.String"] = None,
    parameter_group_name: Optional["capo_memorydb.types.string.String"] = None,
    snapshot_window: Optional["capo_memorydb.types.string.String"] = None,
    snapshot_retention_limit: Optional[
        "capo_memorydb.types.integer_optional.IntegerOptional"
    ] = None,
    node_type: Optional["capo_memorydb.types.string.String"] = None,
    engine: Optional["capo_memorydb.types.string.String"] = None,
    engine_version: Optional["capo_memorydb.types.string.String"] = None,
    replica_configuration: Optional[
        "capo_memorydb.types.replica_configuration_request.ReplicaConfigurationRequest"
    ] = None,
    shard_configuration: Optional[
        "capo_memorydb.types.shard_configuration_request.ShardConfigurationRequest"
    ] = None,
    acl_name: Optional["capo_memorydb.types.acl_name.ACLName"] = None,
    ip_discovery: Optional["capo_memorydb.types.ip_discovery.IpDiscovery"] = None,
) -> "capo_memorydb.types.update_cluster_response.UpdateClusterResponse":
    """<p>Modifies the settings for a cluster. You can use this operation to change one or more cluster configuration settings by specifying the settings and the new values.</p>

    Args:
        cluster_name: <p>The name of the cluster to update.</p>
        description: <p>The description of the cluster to update.</p>
        security_group_ids: <p>The SecurityGroupIds to update.</p>
        maintenance_window: <p>Specifies the weekly time range during which maintenance on the cluster is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period.</p> <p>Valid values for <code>ddd</code> are:</p> <ul> <li> <p> <code>sun</code> </p> </li> <li> <p> <code>mon</code> </p> </li> <li> <p> <code>tue</code> </p> </li> <li> <p> <code>wed</code> </p> </li> <li> <p> <code>thu</code> </p> </li> <li> <p> <code>fri</code> </p> </li> <li> <p> <code>sat</code> </p> </li> </ul> <p>Example: <code>sun:23:00-mon:01:30</code> </p>
        sns_topic_arn: <p>The SNS topic ARN to update.</p>
        sns_topic_status: <p>The status of the Amazon SNS notification topic. Notifications are sent only if the status is active.</p>
        parameter_group_name: <p>The name of the parameter group to update.</p>
        snapshot_window: <p>The daily time range (in UTC) during which MemoryDB begins taking a daily snapshot of your cluster.</p>
        snapshot_retention_limit: <p>The number of days for which MemoryDB retains automatic cluster snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is retained for 5 days before being deleted.</p>
        node_type: <p>A valid node type that you want to scale this cluster up or down to.</p>
        engine: <p>The name of the engine to be used for the cluster.</p>
        engine_version: <p>The upgraded version of the engine to be run on the nodes. You can upgrade to a newer engine version, but you cannot downgrade to an earlier engine version. If you want to use an earlier engine version, you must delete the existing cluster and create it anew with the earlier engine version.</p>
        replica_configuration: <p>The number of replicas that will reside in each shard.</p>
        shard_configuration: <p>The number of shards in the cluster.</p>
        acl_name: <p>The Access Control List that is associated with the cluster.</p>
        ip_discovery: <p>The mechanism for discovering IP addresses for the cluster discovery protocol. Valid values are 'ipv4' or 'ipv6'. When set to 'ipv4', cluster discovery functions such as cluster slots, cluster shards, and cluster nodes will return IPv4 addresses for cluster nodes. When set to 'ipv6', the cluster discovery functions return IPv6 addresses for cluster nodes. The value must be compatible with the NetworkType parameter. If not specified, the default is 'ipv4'.</p>

    Raises:
        capo_memorydb.errors.acl_not_found_fault.ACLNotFoundFault: <p>The specified ACL does not exist.</p>
        capo_memorydb.errors.cluster_not_found_fault.ClusterNotFoundFault: <p>The specified cluster does not exist.</p>
        capo_memorydb.errors.cluster_quota_for_customer_exceeded_fault.ClusterQuotaForCustomerExceededFault: <p>The request cannot be processed because it would exceed the maximum number of clusters allowed for this customer.</p>
        capo_memorydb.errors.invalid_acl_state_fault.InvalidACLStateFault: <p>The ACL is not in a valid state for the requested operation.</p>
        capo_memorydb.errors.invalid_cluster_state_fault.InvalidClusterStateFault: <p>The cluster is not in a valid state for the requested operation.</p>
        capo_memorydb.errors.invalid_kms_key_fault.InvalidKMSKeyFault: <p>The specified KMS key is not valid or accessible.</p>
        capo_memorydb.errors.invalid_node_state_fault.InvalidNodeStateFault: <p>The node is not in a valid state for the requested operation.</p>
        capo_memorydb.errors.invalid_parameter_combination_exception.InvalidParameterCombinationException: <p>The specified parameter combination is not valid.</p>
        capo_memorydb.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The specified parameter value is not valid.</p>
        capo_memorydb.errors.invalid_vpc_network_state_fault.InvalidVPCNetworkStateFault: <p>The VPC network is not in a valid state for the requested operation.</p>
        capo_memorydb.errors.node_quota_for_cluster_exceeded_fault.NodeQuotaForClusterExceededFault: <p>The request cannot be processed because it would exceed the maximum number of nodes allowed for this cluster.</p>
        capo_memorydb.errors.node_quota_for_customer_exceeded_fault.NodeQuotaForCustomerExceededFault: <p>The request cannot be processed because it would exceed the maximum number of nodes allowed for this customer.</p>
        capo_memorydb.errors.no_operation_fault.NoOperationFault: <p>The requested operation would result in no changes.</p>
        capo_memorydb.errors.parameter_group_not_found_fault.ParameterGroupNotFoundFault: <p>The specified parameter group does not exist.</p>
        capo_memorydb.errors.service_linked_role_not_found_fault.ServiceLinkedRoleNotFoundFault: <p>The required service-linked role was not found.</p>
        capo_memorydb.errors.shards_per_cluster_quota_exceeded_fault.ShardsPerClusterQuotaExceededFault: <p>The request cannot be processed because it would exceed the maximum number of shards allowed per cluster.</p>
        capo_memorydb.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_memorydb.types.update_cluster_request.UpdateClusterRequest]",
    ) -> OperationResponse[
        "capo_memorydb.types.update_cluster_response.UpdateClusterResponse"
    ]:
        import capo_memorydb._operations.amazon_memory_db.update_cluster

        output, http_response = (
            capo_memorydb._operations.amazon_memory_db.update_cluster.update_cluster(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateCluster")
    )
    input_: capo_memorydb.types.update_cluster_request.UpdateClusterRequest = {
        "cluster_name": cluster_name
    }
    if description is not None:
        input_["description"] = description
    if security_group_ids is not None:
        input_["security_group_ids"] = security_group_ids
    if maintenance_window is not None:
        input_["maintenance_window"] = maintenance_window
    if sns_topic_arn is not None:
        input_["sns_topic_arn"] = sns_topic_arn
    if sns_topic_status is not None:
        input_["sns_topic_status"] = sns_topic_status
    if parameter_group_name is not None:
        input_["parameter_group_name"] = parameter_group_name
    if snapshot_window is not None:
        input_["snapshot_window"] = snapshot_window
    if snapshot_retention_limit is not None:
        input_["snapshot_retention_limit"] = snapshot_retention_limit
    if node_type is not None:
        input_["node_type"] = node_type
    if engine is not None:
        input_["engine"] = engine
    if engine_version is not None:
        input_["engine_version"] = engine_version
    if replica_configuration is not None:
        input_["replica_configuration"] = replica_configuration
    if shard_configuration is not None:
        input_["shard_configuration"] = shard_configuration
    if acl_name is not None:
        input_["acl_name"] = acl_name
    if ip_discovery is not None:
        input_["ip_discovery"] = ip_discovery

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