Skip to content

update_cluster

update_cluster(
    cluster_arn: str,
    *,
    config_overrides: Optional[DocDBElasticClientConfig] = None,
    auth_type: Optional[Auth] = None,
    shard_capacity: Optional[int] = None,
    shard_count: Optional[int] = None,
    vpc_security_group_ids: Optional[StringList] = None,
    subnet_ids: Optional[StringList] = None,
    admin_user_password: Optional[Password] = None,
    client_token: Optional[str] = None,
    preferred_maintenance_window: Optional[str] = None,
    backup_retention_period: Optional[int] = None,
    preferred_backup_window: Optional[str] = None,
    shard_instance_count: Optional[int] = None,
) -> UpdateClusterOutput

Modifies an elastic cluster. This includes updating admin-username/password, upgrading the API version, and setting up a backup window and maintenance window

Parameters:

  • cluster_arn (str) –

    The ARN identifier of the elastic cluster.

  • auth_type (Optional[Auth], default: None ) –

    The authentication type used to determine where to fetch the password used for accessing the elastic cluster. Valid types are PLAIN_TEXT or SECRET_ARN.

  • shard_capacity (Optional[int], default: None ) –

    The number of vCPUs assigned to each elastic cluster shard. Maximum is 64. Allowed values are 2, 4, 8, 16, 32, 64.

  • shard_count (Optional[int], default: None ) –

    The number of shards assigned to the elastic cluster. Maximum is 32.

  • vpc_security_group_ids (Optional[StringList], default: None ) –

    A list of EC2 VPC security groups to associate with the elastic cluster.

  • subnet_ids (Optional[StringList], default: None ) –

    The Amazon EC2 subnet IDs for the elastic cluster.

  • admin_user_password (Optional[Password], default: None ) –

    The password associated with the elastic cluster administrator. This password can contain any printable ASCII character except forward slash (/), double quote ("), or the "at" symbol (@).

    Constraints: Must contain from 8 to 100 characters.

  • client_token (Optional[str], default: None ) –

    The client token for the elastic cluster.

  • preferred_maintenance_window (Optional[str], default: None ) –

    The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).

    Format: ddd:hh24:mi-ddd:hh24:mi

    Default: a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.

    Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun

    Constraints: Minimum 30-minute window.

  • backup_retention_period (Optional[int], default: None ) –

    The number of days for which automatic snapshots are retained.

  • preferred_backup_window (Optional[str], default: None ) –

    The daily time range during which automated backups are created if automated backups are enabled, as determined by the backupRetentionPeriod.

  • shard_instance_count (Optional[int], default: None ) –

    The number of replica instances applying to all shards in the elastic cluster. A shardInstanceCount value of 1 means there is one writer instance, and any additional instances are replicas that can be used for reads and to improve availability.

Raises:

Source code in docs_src/capo_docdb_elastic/_services/doc_db_elastic.py
def update_cluster(
    self,
    cluster_arn: str,
    *,
    config_overrides: Optional[DocDBElasticClientConfig] = None,
    auth_type: Optional["capo_docdb_elastic.types.auth.Auth"] = None,
    shard_capacity: Optional[int] = None,
    shard_count: Optional[int] = None,
    vpc_security_group_ids: Optional[
        "capo_docdb_elastic.types.string_list.StringList"
    ] = None,
    subnet_ids: Optional["capo_docdb_elastic.types.string_list.StringList"] = None,
    admin_user_password: Optional[
        "capo_docdb_elastic.types.password.Password"
    ] = None,
    client_token: Optional[str] = None,
    preferred_maintenance_window: Optional[str] = None,
    backup_retention_period: Optional[int] = None,
    preferred_backup_window: Optional[str] = None,
    shard_instance_count: Optional[int] = None,
) -> "capo_docdb_elastic.types.update_cluster_output.UpdateClusterOutput":
    """<p>Modifies an elastic cluster. This includes updating admin-username/password, upgrading the API version, and setting up a backup window and maintenance window</p>

    Args:
        cluster_arn: <p>The ARN identifier of the elastic cluster.</p>
        auth_type: <p>The authentication type used to determine where to fetch the password used for accessing the elastic cluster. Valid types are <code>PLAIN_TEXT</code> or <code>SECRET_ARN</code>.</p>
        shard_capacity: <p>The number of vCPUs assigned to each elastic cluster shard. Maximum is 64. Allowed values are 2, 4, 8, 16, 32, 64.</p>
        shard_count: <p>The number of shards assigned to the elastic cluster. Maximum is 32.</p>
        vpc_security_group_ids: <p>A list of EC2 VPC security groups to associate with the elastic cluster.</p>
        subnet_ids: <p>The Amazon EC2 subnet IDs for the elastic cluster.</p>
        admin_user_password: <p>The password associated with the elastic cluster administrator. This password can contain any printable ASCII character except forward slash (/), double quote ("), or the "at" symbol (@).</p> <p> <i>Constraints</i>: Must contain from 8 to 100 characters.</p>
        client_token: <p>The client token for the elastic cluster.</p>
        preferred_maintenance_window: <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p> <p> <i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code> </p> <p> <i>Default</i>: a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region, occurring on a random day of the week.</p> <p> <i>Valid days</i>: Mon, Tue, Wed, Thu, Fri, Sat, Sun</p> <p> <i>Constraints</i>: Minimum 30-minute window.</p>
        backup_retention_period: <p>The number of days for which automatic snapshots are retained.</p>
        preferred_backup_window: <p>The daily time range during which automated backups are created if automated backups are enabled, as determined by the <code>backupRetentionPeriod</code>.</p>
        shard_instance_count: <p>The number of replica instances applying to all shards in the elastic cluster. A <code>shardInstanceCount</code> value of 1 means there is one writer instance, and any additional instances are replicas that can be used for reads and to improve availability.</p>

    Raises:
        capo_docdb_elastic.errors.access_denied_exception.AccessDeniedException: <p>An exception that occurs when there are not sufficient permissions to perform an action.</p>
        capo_docdb_elastic.errors.conflict_exception.ConflictException: <p>There was an access conflict.</p>
        capo_docdb_elastic.errors.internal_server_exception.InternalServerException: <p>There was an internal server error.</p>
        capo_docdb_elastic.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be located.</p>
        capo_docdb_elastic.errors.throttling_exception.ThrottlingException: <p>ThrottlingException will be thrown when request was denied due to request throttling.</p>
        capo_docdb_elastic.errors.validation_exception.ValidationException: <p>A structure defining a validation exception.</p>
        capo_docdb_elastic.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_docdb_elastic.types.update_cluster_input.UpdateClusterInput]",
    ) -> OperationResponse[
        "capo_docdb_elastic.types.update_cluster_output.UpdateClusterOutput"
    ]:
        import capo_docdb_elastic._operations.chimera_db_lionfish_service_lambda.update_cluster

        output, http_response = (
            capo_docdb_elastic._operations.chimera_db_lionfish_service_lambda.update_cluster.update_cluster(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_docdb_elastic.types.update_cluster_input.UpdateClusterInput",
    ) -> dict[str, Any]:
        import capo_docdb_elastic.types.update_cluster_input

        return capo_docdb_elastic.types.update_cluster_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateCluster", redact_input=_redact_input),
    )
    input_: capo_docdb_elastic.types.update_cluster_input.UpdateClusterInput = {
        "cluster_arn": cluster_arn
    }
    if auth_type is not None:
        input_["auth_type"] = auth_type
    if shard_capacity is not None:
        input_["shard_capacity"] = shard_capacity
    if shard_count is not None:
        input_["shard_count"] = shard_count
    if vpc_security_group_ids is not None:
        input_["vpc_security_group_ids"] = vpc_security_group_ids
    if subnet_ids is not None:
        input_["subnet_ids"] = subnet_ids
    if admin_user_password is not None:
        input_["admin_user_password"] = admin_user_password
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if preferred_maintenance_window is not None:
        input_["preferred_maintenance_window"] = preferred_maintenance_window
    if backup_retention_period is not None:
        input_["backup_retention_period"] = backup_retention_period
    if preferred_backup_window is not None:
        input_["preferred_backup_window"] = preferred_backup_window
    if shard_instance_count is not None:
        input_["shard_instance_count"] = shard_instance_count

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