Skip to content

modify_db_cluster

modify_db_cluster(
    *,
    config_overrides: Optional[NeptuneClientConfig] = None,
    db_cluster_identifier: Optional[String] = None,
    new_db_cluster_identifier: Optional[String] = None,
    apply_immediately: Optional[Boolean] = None,
    backup_retention_period: Optional[IntegerOptional] = None,
    db_cluster_parameter_group_name: Optional[String] = None,
    vpc_security_group_ids: Optional[VpcSecurityGroupIdList] = None,
    port: Optional[IntegerOptional] = None,
    master_user_password: Optional[String] = None,
    option_group_name: Optional[String] = None,
    preferred_backup_window: Optional[String] = None,
    preferred_maintenance_window: Optional[String] = None,
    enable_iam_database_authentication: Optional[BooleanOptional] = None,
    cloudwatch_logs_export_configuration: Optional[
        CloudwatchLogsExportConfiguration
    ] = None,
    engine_version: Optional[String] = None,
    allow_major_version_upgrade: Optional[Boolean] = None,
    db_instance_parameter_group_name: Optional[String] = None,
    deletion_protection: Optional[BooleanOptional] = None,
    copy_tags_to_snapshot: Optional[BooleanOptional] = None,
    serverless_v2_scaling_configuration: Optional[
        ServerlessV2ScalingConfiguration
    ] = None,
    storage_type: Optional[String] = None,
    network_type: Optional[String] = None,
) -> ModifyDBClusterResult

Modify a setting for a DB cluster. You can change one or more database configuration parameters by specifying these parameters and the new values in the request.

Parameters:

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

    The DB cluster identifier for the cluster being modified. This parameter is not case-sensitive.

    Constraints:

    • Must match the identifier of an existing DBCluster.

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

    The new DB cluster identifier for the DB cluster when renaming a DB cluster. This value is stored as a lowercase string.

    Constraints:

    • Must contain from 1 to 63 letters, numbers, or hyphens

    • The first character must be a letter

    • Cannot end with a hyphen or contain two consecutive hyphens

    Example: my-cluster2

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

    A value that specifies whether the modifications in this request and any pending modifications are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the DB cluster. If this parameter is set to false, changes to the DB cluster are applied during the next maintenance window.

    The ApplyImmediately parameter only affects NewDBClusterIdentifier values. If you set the ApplyImmediately parameter value to false, then changes to NewDBClusterIdentifier values are applied during the next maintenance window. All other changes are applied immediately, regardless of the value of the ApplyImmediately parameter.

    Default: false

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

    The number of days for which automated backups are retained. You must specify a minimum value of 1.

    Default: 1

    Constraints:

    • Must be a value from 1 to 35

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

    The name of the DB cluster parameter group to use for the DB cluster.

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

    A list of VPC security groups that the DB cluster will belong to.

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

    The port number on which the DB cluster accepts connections.

    Constraints: Value must be 1150-65535

    Default: The same port as the original DB cluster.

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

    Not supported by Neptune.

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

    Not supported by Neptune.

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

    The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter.

    The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Region.

    Constraints:

    • Must be in the format hh24:mi-hh24:mi.

    • Must be in Universal Coordinated Time (UTC).

    • Must not conflict with the preferred maintenance window.

    • Must be at least 30 minutes.

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

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

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

    The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Region, occurring on a random day of the week.

    Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.

    Constraints: Minimum 30-minute window.

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

    True to enable mapping of Amazon Identity and Access Management (IAM) accounts to database accounts, and otherwise false.

    Default: false

  • cloudwatch_logs_export_configuration (Optional[CloudwatchLogsExportConfiguration], default: None ) –

    The configuration setting for the log types to be enabled for export to CloudWatch Logs for a specific DB cluster. See Using the CLI to publish Neptune audit logs to CloudWatch Logs.

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

    The version number of the database engine to which you want to upgrade. Changing this parameter results in an outage. The change is applied during the next maintenance window unless the ApplyImmediately parameter is set to true.

    For a list of valid engine versions, see Engine Releases for Amazon Neptune, or call DescribeDBEngineVersions.

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

    A value that indicates whether upgrades between different major versions are allowed.

    Constraints: You must set the allow-major-version-upgrade flag when providing an EngineVersion parameter that uses a different major version than the DB cluster's current version.

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

    The name of the DB parameter group to apply to all instances of the DB cluster.

    When you apply a parameter group using DBInstanceParameterGroupName, parameter changes aren't applied during the next maintenance window but instead are applied immediately.

    Default: The existing name setting

    Constraints:

    • The DB parameter group must be in the same DB parameter group family as the target DB cluster version.

    • The DBInstanceParameterGroupName parameter is only valid in combination with the AllowMajorVersionUpgrade parameter.

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

    A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is disabled.

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

    If set to true, tags are copied to any snapshot of the DB cluster that is created.

  • serverless_v2_scaling_configuration (Optional[ServerlessV2ScalingConfiguration], default: None ) –

    Contains the scaling configuration of a Neptune Serverless DB cluster.

    For more information, see Using Amazon Neptune Serverless in the Amazon Neptune User Guide.

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

    The storage type to associate with the DB cluster.

    Valid Values:

    • standard – ( the default ) Configures cost-effective database storage for applications with moderate to small I/O usage.

    • iopt1 – Enables I/O-Optimized storage that's designed to meet the needs of I/O-intensive graph workloads that require predictable pricing with low I/O latency and consistent I/O throughput.

      Neptune I/O-Optimized storage is only available starting with engine release 1.3.0.0.

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

    The network type of the DB cluster.

    Valid Values:

    • IPV4 – The DB cluster uses only IPv4 addresses for communication.

    • DUAL – The DB cluster uses both IPv4 and IPv6 addresses for communication. The DB subnet group associated with the cluster must support IPv6.

Raises:

Source code in docs_src/capo_neptune/_services/neptune.py
def modify_db_cluster(
    self,
    *,
    config_overrides: Optional[NeptuneClientConfig] = None,
    db_cluster_identifier: Optional["capo_neptune.types.string.String"] = None,
    new_db_cluster_identifier: Optional["capo_neptune.types.string.String"] = None,
    apply_immediately: Optional["capo_neptune.types.boolean.Boolean"] = None,
    backup_retention_period: Optional[
        "capo_neptune.types.integer_optional.IntegerOptional"
    ] = None,
    db_cluster_parameter_group_name: Optional[
        "capo_neptune.types.string.String"
    ] = None,
    vpc_security_group_ids: Optional[
        "capo_neptune.types.vpc_security_group_id_list.VpcSecurityGroupIdList"
    ] = None,
    port: Optional["capo_neptune.types.integer_optional.IntegerOptional"] = None,
    master_user_password: Optional["capo_neptune.types.string.String"] = None,
    option_group_name: Optional["capo_neptune.types.string.String"] = None,
    preferred_backup_window: Optional["capo_neptune.types.string.String"] = None,
    preferred_maintenance_window: Optional[
        "capo_neptune.types.string.String"
    ] = None,
    enable_iam_database_authentication: Optional[
        "capo_neptune.types.boolean_optional.BooleanOptional"
    ] = None,
    cloudwatch_logs_export_configuration: Optional[
        "capo_neptune.types.cloudwatch_logs_export_configuration.CloudwatchLogsExportConfiguration"
    ] = None,
    engine_version: Optional["capo_neptune.types.string.String"] = None,
    allow_major_version_upgrade: Optional[
        "capo_neptune.types.boolean.Boolean"
    ] = None,
    db_instance_parameter_group_name: Optional[
        "capo_neptune.types.string.String"
    ] = None,
    deletion_protection: Optional[
        "capo_neptune.types.boolean_optional.BooleanOptional"
    ] = None,
    copy_tags_to_snapshot: Optional[
        "capo_neptune.types.boolean_optional.BooleanOptional"
    ] = None,
    serverless_v2_scaling_configuration: Optional[
        "capo_neptune.types.serverless_v2_scaling_configuration.ServerlessV2ScalingConfiguration"
    ] = None,
    storage_type: Optional["capo_neptune.types.string.String"] = None,
    network_type: Optional["capo_neptune.types.string.String"] = None,
) -> "capo_neptune.types.modify_db_cluster_result.ModifyDBClusterResult":
    """<p>Modify a setting for a DB cluster. You can change one or more database configuration parameters by specifying these parameters and the new values in the request.</p>

    Args:
        db_cluster_identifier: <p>The DB cluster identifier for the cluster being modified. This parameter is not case-sensitive.</p> <p>Constraints:</p> <ul> <li> <p>Must match the identifier of an existing DBCluster.</p> </li> </ul>
        new_db_cluster_identifier: <p>The new DB cluster identifier for the DB cluster when renaming a DB cluster. This value is stored as a lowercase string.</p> <p>Constraints:</p> <ul> <li> <p>Must contain from 1 to 63 letters, numbers, or hyphens</p> </li> <li> <p>The first character must be a letter</p> </li> <li> <p>Cannot end with a hyphen or contain two consecutive hyphens</p> </li> </ul> <p>Example: <code>my-cluster2</code> </p>
        apply_immediately: <p>A value that specifies whether the modifications in this request and any pending modifications are asynchronously applied as soon as possible, regardless of the <code>PreferredMaintenanceWindow</code> setting for the DB cluster. If this parameter is set to <code>false</code>, changes to the DB cluster are applied during the next maintenance window.</p> <p>The <code>ApplyImmediately</code> parameter only affects <code>NewDBClusterIdentifier</code> values. If you set the <code>ApplyImmediately</code> parameter value to false, then changes to <code>NewDBClusterIdentifier</code> values are applied during the next maintenance window. All other changes are applied immediately, regardless of the value of the <code>ApplyImmediately</code> parameter.</p> <p>Default: <code>false</code> </p>
        backup_retention_period: <p>The number of days for which automated backups are retained. You must specify a minimum value of 1.</p> <p>Default: 1</p> <p>Constraints:</p> <ul> <li> <p>Must be a value from 1 to 35</p> </li> </ul>
        db_cluster_parameter_group_name: <p>The name of the DB cluster parameter group to use for the DB cluster.</p>
        vpc_security_group_ids: <p>A list of VPC security groups that the DB cluster will belong to.</p>
        port: <p>The port number on which the DB cluster accepts connections.</p> <p>Constraints: Value must be <code>1150-65535</code> </p> <p>Default: The same port as the original DB cluster.</p>
        master_user_password: <p>Not supported by Neptune.</p>
        option_group_name: <p> <i>Not supported by Neptune.</i> </p>
        preferred_backup_window: <p>The daily time range during which automated backups are created if automated backups are enabled, using the <code>BackupRetentionPeriod</code> parameter.</p> <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Region.</p> <p>Constraints:</p> <ul> <li> <p>Must be in the format <code>hh24:mi-hh24:mi</code>.</p> </li> <li> <p>Must be in Universal Coordinated Time (UTC).</p> </li> <li> <p>Must not conflict with the preferred maintenance window.</p> </li> <li> <p>Must be at least 30 minutes.</p> </li> </ul>
        preferred_maintenance_window: <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p> <p>Format: <code>ddd:hh24:mi-ddd:hh24:mi</code> </p> <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Region, occurring on a random day of the week.</p> <p>Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.</p> <p>Constraints: Minimum 30-minute window.</p>
        enable_iam_database_authentication: <p>True to enable mapping of Amazon Identity and Access Management (IAM) accounts to database accounts, and otherwise false.</p> <p>Default: <code>false</code> </p>
        cloudwatch_logs_export_configuration: <p>The configuration setting for the log types to be enabled for export to CloudWatch Logs for a specific DB cluster. See <a href="https://docs.aws.amazon.com/neptune/latest/userguide/cloudwatch-logs.html#cloudwatch-logs-cli">Using the CLI to publish Neptune audit logs to CloudWatch Logs</a>.</p>
        engine_version: <p>The version number of the database engine to which you want to upgrade. Changing this parameter results in an outage. The change is applied during the next maintenance window unless the <code>ApplyImmediately</code> parameter is set to true.</p> <p>For a list of valid engine versions, see <a href="https://docs.aws.amazon.com/neptune/latest/userguide/engine-releases.html">Engine Releases for Amazon Neptune</a>, or call <a>DescribeDBEngineVersions</a>.</p>
        allow_major_version_upgrade: <p>A value that indicates whether upgrades between different major versions are allowed.</p> <p>Constraints: You must set the allow-major-version-upgrade flag when providing an <code>EngineVersion</code> parameter that uses a different major version than the DB cluster's current version.</p>
        db_instance_parameter_group_name: <p>The name of the DB parameter group to apply to all instances of the DB cluster. </p> <note> <p>When you apply a parameter group using <code>DBInstanceParameterGroupName</code>, parameter changes aren't applied during the next maintenance window but instead are applied immediately.</p> </note> <p>Default: The existing name setting</p> <p>Constraints:</p> <ul> <li> <p>The DB parameter group must be in the same DB parameter group family as the target DB cluster version.</p> </li> <li> <p>The <code>DBInstanceParameterGroupName</code> parameter is only valid in combination with the <code>AllowMajorVersionUpgrade</code> parameter.</p> </li> </ul>
        deletion_protection: <p>A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is disabled.</p>
        copy_tags_to_snapshot: <p> <i>If set to <code>true</code>, tags are copied to any snapshot of the DB cluster that is created.</i> </p>
        serverless_v2_scaling_configuration: <p>Contains the scaling configuration of a Neptune Serverless DB cluster.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/neptune/latest/userguide/neptune-serverless-using.html">Using Amazon Neptune Serverless</a> in the <i>Amazon Neptune User Guide</i>.</p>
        storage_type: <p>The storage type to associate with the DB cluster.</p> <p>Valid Values:</p> <ul> <li> <p> <b> <code>standard</code> </b> – ( <i>the default</i> ) Configures cost-effective database storage for applications with moderate to small I/O usage.</p> </li> <li> <p> <b> <code>iopt1</code> </b> – Enables <a href="https://docs.aws.amazon.com/neptune/latest/userguide/storage-types.html#provisioned-iops-storage">I/O-Optimized storage</a> that's designed to meet the needs of I/O-intensive graph workloads that require predictable pricing with low I/O latency and consistent I/O throughput.</p> <p>Neptune I/O-Optimized storage is only available starting with engine release 1.3.0.0.</p> </li> </ul>
        network_type: <p>The network type of the DB cluster.</p> <p>Valid Values:</p> <ul> <li> <p> <b> <code>IPV4</code> </b> – The DB cluster uses only IPv4 addresses for communication.</p> </li> <li> <p> <b> <code>DUAL</code> </b> – The DB cluster uses both IPv4 and IPv6 addresses for communication. The DB subnet group associated with the cluster must support IPv6.</p> </li> </ul>

    Raises:
        capo_neptune.errors.db_cluster_already_exists_fault.DBClusterAlreadyExistsFault: <p>User already has a DB cluster with the given identifier.</p>
        capo_neptune.errors.db_cluster_not_found_fault.DBClusterNotFoundFault: <p> <i>DBClusterIdentifier</i> does not refer to an existing DB cluster.</p>
        capo_neptune.errors.db_cluster_parameter_group_not_found_fault.DBClusterParameterGroupNotFoundFault: <p> <i>DBClusterParameterGroupName</i> does not refer to an existing DB Cluster parameter group.</p>
        capo_neptune.errors.db_subnet_group_not_found_fault.DBSubnetGroupNotFoundFault: <p> <i>DBSubnetGroupName</i> does not refer to an existing DB subnet group.</p>
        capo_neptune.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The DB cluster is not in a valid state.</p>
        capo_neptune.errors.invalid_db_instance_state_fault.InvalidDBInstanceStateFault: <p>The specified DB instance is not in the <i>available</i> state.</p>
        capo_neptune.errors.invalid_db_security_group_state_fault.InvalidDBSecurityGroupStateFault: <p>The state of the DB security group does not allow deletion.</p>
        capo_neptune.errors.invalid_db_subnet_group_state_fault.InvalidDBSubnetGroupStateFault: <p>The DB subnet group cannot be deleted because it is in use.</p>
        capo_neptune.errors.invalid_subnet.InvalidSubnet: <p>The requested subnet is invalid, or multiple subnets were requested that are not all in a common VPC.</p>
        capo_neptune.errors.invalid_vpc_network_state_fault.InvalidVPCNetworkStateFault: <p>DB subnet group does not cover all Availability Zones after it is created because users' change.</p>
        capo_neptune.errors.network_type_not_supported_fault.NetworkTypeNotSupportedFault: <p>The specified <i>NetworkType</i> is not supported for the DB cluster, DB subnet group, or orderable DB instance option.</p>
        capo_neptune.errors.storage_quota_exceeded_fault.StorageQuotaExceededFault: <p>Request would result in user exceeding the allowed amount of storage available across all DB instances.</p>
        capo_neptune.errors.storage_type_not_supported_fault.StorageTypeNotSupportedFault: <p> <i>StorageType</i> specified cannot be associated with the DB Instance.</p>
        capo_neptune.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_neptune.types.modify_db_cluster_message.ModifyDBClusterMessage]",
    ) -> OperationResponse[
        "capo_neptune.types.modify_db_cluster_result.ModifyDBClusterResult"
    ]:
        import capo_neptune._operations.amazon_rd_sv19.modify_db_cluster

        output, http_response = (
            capo_neptune._operations.amazon_rd_sv19.modify_db_cluster.modify_db_cluster(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyDBCluster")
    )
    input_: capo_neptune.types.modify_db_cluster_message.ModifyDBClusterMessage = {}
    if db_cluster_identifier is not None:
        input_["db_cluster_identifier"] = db_cluster_identifier
    if new_db_cluster_identifier is not None:
        input_["new_db_cluster_identifier"] = new_db_cluster_identifier
    if apply_immediately is not None:
        input_["apply_immediately"] = apply_immediately
    if backup_retention_period is not None:
        input_["backup_retention_period"] = backup_retention_period
    if db_cluster_parameter_group_name is not None:
        input_["db_cluster_parameter_group_name"] = db_cluster_parameter_group_name
    if vpc_security_group_ids is not None:
        input_["vpc_security_group_ids"] = vpc_security_group_ids
    if port is not None:
        input_["port"] = port
    if master_user_password is not None:
        input_["master_user_password"] = master_user_password
    if option_group_name is not None:
        input_["option_group_name"] = option_group_name
    if preferred_backup_window is not None:
        input_["preferred_backup_window"] = preferred_backup_window
    if preferred_maintenance_window is not None:
        input_["preferred_maintenance_window"] = preferred_maintenance_window
    if enable_iam_database_authentication is not None:
        input_["enable_iam_database_authentication"] = (
            enable_iam_database_authentication
        )
    if cloudwatch_logs_export_configuration is not None:
        input_["cloudwatch_logs_export_configuration"] = (
            cloudwatch_logs_export_configuration
        )
    if engine_version is not None:
        input_["engine_version"] = engine_version
    if allow_major_version_upgrade is not None:
        input_["allow_major_version_upgrade"] = allow_major_version_upgrade
    if db_instance_parameter_group_name is not None:
        input_["db_instance_parameter_group_name"] = (
            db_instance_parameter_group_name
        )
    if deletion_protection is not None:
        input_["deletion_protection"] = deletion_protection
    if copy_tags_to_snapshot is not None:
        input_["copy_tags_to_snapshot"] = copy_tags_to_snapshot
    if serverless_v2_scaling_configuration is not None:
        input_["serverless_v2_scaling_configuration"] = (
            serverless_v2_scaling_configuration
        )
    if storage_type is not None:
        input_["storage_type"] = storage_type
    if network_type is not None:
        input_["network_type"] = network_type

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