Skip to content

modify_replication_group

modify_replication_group(
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    replication_group_id: Optional[String] = None,
    replication_group_description: Optional[String] = None,
    primary_cluster_id: Optional[String] = None,
    snapshotting_cluster_id: Optional[String] = None,
    automatic_failover_enabled: Optional[BooleanOptional] = None,
    multi_az_enabled: Optional[BooleanOptional] = None,
    node_group_id: Optional[String] = None,
    cache_security_group_names: Optional[CacheSecurityGroupNameList] = None,
    security_group_ids: Optional[SecurityGroupIdsList] = None,
    preferred_maintenance_window: Optional[String] = None,
    notification_topic_arn: Optional[String] = None,
    cache_parameter_group_name: Optional[String] = None,
    notification_topic_status: Optional[String] = None,
    apply_immediately: Optional[Boolean] = None,
    engine: Optional[String] = None,
    engine_version: Optional[String] = None,
    auto_minor_version_upgrade: Optional[BooleanOptional] = None,
    snapshot_retention_limit: Optional[IntegerOptional] = None,
    snapshot_window: Optional[String] = None,
    cache_node_type: Optional[String] = None,
    auth_token: Optional[String] = None,
    auth_token_update_strategy: Optional[AuthTokenUpdateStrategyType] = None,
    user_group_ids_to_add: Optional[UserGroupIdList] = None,
    user_group_ids_to_remove: Optional[UserGroupIdList] = None,
    remove_user_groups: Optional[BooleanOptional] = None,
    log_delivery_configurations: Optional[LogDeliveryConfigurationRequestList] = None,
    ip_discovery: Optional[IpDiscovery] = None,
    transit_encryption_enabled: Optional[BooleanOptional] = None,
    transit_encryption_mode: Optional[TransitEncryptionMode] = None,
    cluster_mode: Optional[ClusterMode] = None,
    durability: Optional[Durability] = None,
) -> ModifyReplicationGroupResult

Modifies the settings for a replication group. This is limited to Valkey and Redis OSS 7 and above.

This operation is valid for Valkey or Redis OSS only.

Parameters:

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

    The identifier of the replication group to modify.

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

    A description for the replication group. Maximum length is 255 characters.

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

    For replication groups with a single primary, if this parameter is specified, ElastiCache promotes the specified cluster in the specified replication group to the primary role. The nodes of all other clusters in the replication group are read replicas.

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

    The cluster ID that is used as the daily snapshot source for the replication group. This parameter cannot be set for Valkey or Redis OSS (cluster mode enabled) replication groups.

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

    Determines whether a read replica is automatically promoted to read/write primary if the existing primary encounters a failure.

    Valid values: true | false

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

    A flag to indicate MultiAZ is enabled.

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

    Deprecated. This parameter is not used.

  • cache_security_group_names (Optional[CacheSecurityGroupNameList], default: None ) –

    A list of cache security group names to authorize for the clusters in this replication group. This change is asynchronously applied as soon as possible.

    This parameter can be used only with replication group containing clusters running outside of an Amazon Virtual Private Cloud (Amazon VPC).

    Constraints: Must contain no more than 255 alphanumeric characters. Must not be Default.

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

    Specifies the VPC Security Groups associated with the clusters in the replication group.

    This parameter can be used only with replication group containing clusters running in an Amazon Virtual Private Cloud (Amazon VPC).

  • preferred_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

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

    The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications are sent.

    The Amazon SNS topic owner must be same as the replication group owner.

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

    The name of the cache parameter group to apply to all of the clusters in this replication group. This change is asynchronously applied as soon as possible for parameters when the ApplyImmediately parameter is specified as true for this request.

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

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

    Valid values: active | inactive

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

    If true, this parameter causes the modifications in this request and any pending modifications to be applied, asynchronously and as soon as possible, regardless of the PreferredMaintenanceWindow setting for the replication group.

    If false, changes to the nodes in the replication group are applied on the next maintenance reboot, or the next failure reboot, whichever occurs first.

    Valid values: true | false

    Default: false

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

    Modifies the engine listed in a replication group message. The options are valkey, memcached or redis.

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

    The upgraded version of the cache engine to be run on the clusters in the replication group.

    Important: You can upgrade to a newer engine version (see Selecting a Cache Engine and Version), but you cannot downgrade to an earlier engine version. If you want to use an earlier engine version, you must delete the existing replication group and create it anew with the earlier engine version.

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

    If you are running Valkey or Redis OSS engine version 6.0 or later, set this parameter to yes if you want to opt-in to the next auto minor version upgrade campaign. This parameter is disabled for previous versions.

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

    The number of days for which ElastiCache retains automatic node group (shard) 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.

    Important If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off.

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

    The daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of the node group (shard) specified by SnapshottingClusterId.

    Example: 05:00-09:00

    If you do not specify this parameter, ElastiCache automatically chooses an appropriate time range.

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

    A valid cache node type that you want to scale this replication group to.

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

    Reserved parameter. The password used to access a password protected server. This parameter must be specified with the auth-token-update-strategy parameter. Password constraints:

    • Must be only printable ASCII characters

    • Must be at least 16 characters and no more than 128 characters in length

    • Cannot contain any of the following characters: '/', '"', or '@', '%'

    For more information, see AUTH password at AUTH.

  • auth_token_update_strategy (Optional[AuthTokenUpdateStrategyType], default: None ) –

    Specifies the strategy to use to update the AUTH token. This parameter must be specified with the auth-token parameter. Possible values:

    • ROTATE - default, if no update strategy is provided

    • SET - allowed only after ROTATE

    • DELETE - allowed only when transitioning to RBAC

    For more information, see Authenticating Users with AUTH

  • user_group_ids_to_add (Optional[UserGroupIdList], default: None ) –

    The ID of the user group you are associating with the replication group.

  • user_group_ids_to_remove (Optional[UserGroupIdList], default: None ) –

    The ID of the user group to disassociate from the replication group, meaning the users in the group no longer can access the replication group.

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

    Removes the user group associated with this replication group.

  • log_delivery_configurations (Optional[LogDeliveryConfigurationRequestList], default: None ) –

    Specifies the destination, format and type of the logs.

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

    The network type you choose when modifying a cluster, either ipv4 | ipv6. IPv6 is supported for workloads using Valkey 7.2 and above, Redis OSS engine version 6.2 to 7.1 and Memcached engine version 1.6.6 and above on all instances built on the Nitro system.

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

    A flag that enables in-transit encryption when set to true. If you are enabling in-transit encryption for an existing cluster, you must also set TransitEncryptionMode to preferred.

  • transit_encryption_mode (Optional[TransitEncryptionMode], default: None ) –

    A setting that allows you to migrate your clients to use in-transit encryption, with no downtime.

    You must set TransitEncryptionEnabled to true, for your existing cluster, and set TransitEncryptionMode to preferred in the same request to allow both encrypted and unencrypted connections at the same time. Once you migrate all your Valkey or Redis OSS clients to use encrypted connections you can set the value to required to allow encrypted connections only.

    Setting TransitEncryptionMode to required is a two-step process that requires you to first set the TransitEncryptionMode to preferred, after that you can set TransitEncryptionMode to required.

  • cluster_mode (Optional[ClusterMode], default: None ) –

    Enabled or Disabled. To modify cluster mode from Disabled to Enabled, you must first set the cluster mode to Compatible. Compatible mode allows your Valkey or Redis OSS clients to connect using both cluster mode enabled and cluster mode disabled. After you migrate all Valkey or Redis OSS clients to use cluster mode enabled, you can then complete cluster mode configuration and set the cluster mode to Enabled.

  • durability (Optional[Durability], default: None ) –

    Specifies the durability setting for the replication group. Use this parameter to change the durability mode of an existing replication group, for example from sync to async or vice versa. For more information, see Durability.

Raises:

Examples:

ModifyReplicationGroup

>>> client.modify_replication_group(replication_group_id='my-redis-rg', replication_group_description='Modified replication group', snapshotting_cluster_id='my-redis-rg-001', apply_immediately=True, snapshot_retention_limit=30)
Source code in docs_src/capo_elasticache/_services/elasti_cache.py
def modify_replication_group(
    self,
    *,
    config_overrides: Optional[ElastiCacheClientConfig] = None,
    replication_group_id: Optional["capo_elasticache.types.string.String"] = None,
    replication_group_description: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    primary_cluster_id: Optional["capo_elasticache.types.string.String"] = None,
    snapshotting_cluster_id: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    automatic_failover_enabled: Optional[
        "capo_elasticache.types.boolean_optional.BooleanOptional"
    ] = None,
    multi_az_enabled: Optional[
        "capo_elasticache.types.boolean_optional.BooleanOptional"
    ] = None,
    node_group_id: Optional["capo_elasticache.types.string.String"] = None,
    cache_security_group_names: Optional[
        "capo_elasticache.types.cache_security_group_name_list.CacheSecurityGroupNameList"
    ] = None,
    security_group_ids: Optional[
        "capo_elasticache.types.security_group_ids_list.SecurityGroupIdsList"
    ] = None,
    preferred_maintenance_window: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    notification_topic_arn: Optional["capo_elasticache.types.string.String"] = None,
    cache_parameter_group_name: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    notification_topic_status: Optional[
        "capo_elasticache.types.string.String"
    ] = None,
    apply_immediately: Optional["capo_elasticache.types.boolean.Boolean"] = None,
    engine: Optional["capo_elasticache.types.string.String"] = None,
    engine_version: Optional["capo_elasticache.types.string.String"] = None,
    auto_minor_version_upgrade: Optional[
        "capo_elasticache.types.boolean_optional.BooleanOptional"
    ] = None,
    snapshot_retention_limit: Optional[
        "capo_elasticache.types.integer_optional.IntegerOptional"
    ] = None,
    snapshot_window: Optional["capo_elasticache.types.string.String"] = None,
    cache_node_type: Optional["capo_elasticache.types.string.String"] = None,
    auth_token: Optional["capo_elasticache.types.string.String"] = None,
    auth_token_update_strategy: Optional[
        "capo_elasticache.types.auth_token_update_strategy_type.AuthTokenUpdateStrategyType"
    ] = None,
    user_group_ids_to_add: Optional[
        "capo_elasticache.types.user_group_id_list.UserGroupIdList"
    ] = None,
    user_group_ids_to_remove: Optional[
        "capo_elasticache.types.user_group_id_list.UserGroupIdList"
    ] = None,
    remove_user_groups: Optional[
        "capo_elasticache.types.boolean_optional.BooleanOptional"
    ] = None,
    log_delivery_configurations: Optional[
        "capo_elasticache.types.log_delivery_configuration_request_list.LogDeliveryConfigurationRequestList"
    ] = None,
    ip_discovery: Optional[
        "capo_elasticache.types.ip_discovery.IpDiscovery"
    ] = None,
    transit_encryption_enabled: Optional[
        "capo_elasticache.types.boolean_optional.BooleanOptional"
    ] = None,
    transit_encryption_mode: Optional[
        "capo_elasticache.types.transit_encryption_mode.TransitEncryptionMode"
    ] = None,
    cluster_mode: Optional[
        "capo_elasticache.types.cluster_mode.ClusterMode"
    ] = None,
    durability: Optional["capo_elasticache.types.durability.Durability"] = None,
) -> "capo_elasticache.types.modify_replication_group_result.ModifyReplicationGroupResult":
    """<p>Modifies the settings for a replication group. This is limited to Valkey and Redis OSS 7 and above.</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/scaling-redis-cluster-mode-enabled.html">Scaling for Valkey or Redis OSS (cluster mode enabled)</a> in the ElastiCache User Guide</p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_ModifyReplicationGroupShardConfiguration.html">ModifyReplicationGroupShardConfiguration</a> in the ElastiCache API Reference</p> </li> </ul> <note> <p>This operation is valid for Valkey or Redis OSS only.</p> </note>

    Args:
        replication_group_id: <p>The identifier of the replication group to modify.</p>
        replication_group_description: <p>A description for the replication group. Maximum length is 255 characters.</p>
        primary_cluster_id: <p>For replication groups with a single primary, if this parameter is specified, ElastiCache promotes the specified cluster in the specified replication group to the primary role. The nodes of all other clusters in the replication group are read replicas.</p>
        snapshotting_cluster_id: <p>The cluster ID that is used as the daily snapshot source for the replication group. This parameter cannot be set for Valkey or Redis OSS (cluster mode enabled) replication groups.</p>
        automatic_failover_enabled: <p>Determines whether a read replica is automatically promoted to read/write primary if the existing primary encounters a failure.</p> <p>Valid values: <code>true</code> | <code>false</code> </p>
        multi_az_enabled: <p>A flag to indicate MultiAZ is enabled.</p>
        node_group_id: <p>Deprecated. This parameter is not used.</p>
        cache_security_group_names: <p>A list of cache security group names to authorize for the clusters in this replication group. This change is asynchronously applied as soon as possible.</p> <p>This parameter can be used only with replication group containing clusters running outside of an Amazon Virtual Private Cloud (Amazon VPC).</p> <p>Constraints: Must contain no more than 255 alphanumeric characters. Must not be <code>Default</code>.</p>
        security_group_ids: <p>Specifies the VPC Security Groups associated with the clusters in the replication group.</p> <p>This parameter can be used only with replication group containing clusters running in an Amazon Virtual Private Cloud (Amazon VPC).</p>
        preferred_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>
        notification_topic_arn: <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications are sent.</p> <note> <p>The Amazon SNS topic owner must be same as the replication group owner. </p> </note>
        cache_parameter_group_name: <p>The name of the cache parameter group to apply to all of the clusters in this replication group. This change is asynchronously applied as soon as possible for parameters when the <code>ApplyImmediately</code> parameter is specified as <code>true</code> for this request.</p>
        notification_topic_status: <p>The status of the Amazon SNS notification topic for the replication group. Notifications are sent only if the status is <code>active</code>.</p> <p>Valid values: <code>active</code> | <code>inactive</code> </p>
        apply_immediately: <p>If <code>true</code>, this parameter causes the modifications in this request and any pending modifications to be applied, asynchronously and as soon as possible, regardless of the <code>PreferredMaintenanceWindow</code> setting for the replication group.</p> <p>If <code>false</code>, changes to the nodes in the replication group are applied on the next maintenance reboot, or the next failure reboot, whichever occurs first.</p> <p>Valid values: <code>true</code> | <code>false</code> </p> <p>Default: <code>false</code> </p>
        engine: <p>Modifies the engine listed in a replication group message. The options are valkey, memcached or redis.</p>
        engine_version: <p>The upgraded version of the cache engine to be run on the clusters in the replication group.</p> <p> <b>Important:</b> You can upgrade to a newer engine version (see <a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/SelectEngine.html#VersionManagement">Selecting a Cache Engine and Version</a>), but you cannot downgrade to an earlier engine version. If you want to use an earlier engine version, you must delete the existing replication group and create it anew with the earlier engine version. </p>
        auto_minor_version_upgrade: <p> If you are running Valkey or Redis OSS engine version 6.0 or later, set this parameter to yes if you want to opt-in to the next auto minor version upgrade campaign. This parameter is disabled for previous versions. </p>
        snapshot_retention_limit: <p>The number of days for which ElastiCache retains automatic node group (shard) snapshots before deleting them. For example, if you set <code>SnapshotRetentionLimit</code> to 5, a snapshot that was taken today is retained for 5 days before being deleted.</p> <p> <b>Important</b> If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off.</p>
        snapshot_window: <p>The daily time range (in UTC) during which ElastiCache begins taking a daily snapshot of the node group (shard) specified by <code>SnapshottingClusterId</code>.</p> <p>Example: <code>05:00-09:00</code> </p> <p>If you do not specify this parameter, ElastiCache automatically chooses an appropriate time range.</p>
        cache_node_type: <p>A valid cache node type that you want to scale this replication group to.</p>
        auth_token: <p>Reserved parameter. The password used to access a password protected server. This parameter must be specified with the <code>auth-token-update-strategy </code> parameter. Password constraints:</p> <ul> <li> <p>Must be only printable ASCII characters</p> </li> <li> <p>Must be at least 16 characters and no more than 128 characters in length</p> </li> <li> <p>Cannot contain any of the following characters: '/', '"', or '@', '%'</p> </li> </ul> <p> For more information, see AUTH password at <a href="http://redis.io/commands/AUTH">AUTH</a>.</p>
        auth_token_update_strategy: <p>Specifies the strategy to use to update the AUTH token. This parameter must be specified with the <code>auth-token</code> parameter. Possible values:</p> <ul> <li> <p>ROTATE - default, if no update strategy is provided</p> </li> <li> <p>SET - allowed only after ROTATE</p> </li> <li> <p>DELETE - allowed only when transitioning to RBAC</p> </li> </ul> <p> For more information, see <a href="http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/auth.html">Authenticating Users with AUTH</a> </p>
        user_group_ids_to_add: <p>The ID of the user group you are associating with the replication group.</p>
        user_group_ids_to_remove: <p>The ID of the user group to disassociate from the replication group, meaning the users in the group no longer can access the replication group.</p>
        remove_user_groups: <p>Removes the user group associated with this replication group.</p>
        log_delivery_configurations: <p>Specifies the destination, format and type of the logs.</p>
        ip_discovery: <p>The network type you choose when modifying a cluster, either <code>ipv4</code> | <code>ipv6</code>. IPv6 is supported for workloads using Valkey 7.2 and above, Redis OSS engine version 6.2 to 7.1 and Memcached engine version 1.6.6 and above on all instances built on the <a href="http://aws.amazon.com/ec2/nitro/">Nitro system</a>.</p>
        transit_encryption_enabled: <p>A flag that enables in-transit encryption when set to true. If you are enabling in-transit encryption for an existing cluster, you must also set <code>TransitEncryptionMode</code> to <code>preferred</code>.</p>
        transit_encryption_mode: <p>A setting that allows you to migrate your clients to use in-transit encryption, with no downtime.</p> <p>You must set <code>TransitEncryptionEnabled</code> to <code>true</code>, for your existing cluster, and set <code>TransitEncryptionMode</code> to <code>preferred</code> in the same request to allow both encrypted and unencrypted connections at the same time. Once you migrate all your Valkey or Redis OSS clients to use encrypted connections you can set the value to <code>required</code> to allow encrypted connections only.</p> <p>Setting <code>TransitEncryptionMode</code> to <code>required</code> is a two-step process that requires you to first set the <code>TransitEncryptionMode</code> to <code>preferred</code>, after that you can set <code>TransitEncryptionMode</code> to <code>required</code>. </p>
        cluster_mode: <p>Enabled or Disabled. To modify cluster mode from Disabled to Enabled, you must first set the cluster mode to Compatible. Compatible mode allows your Valkey or Redis OSS clients to connect using both cluster mode enabled and cluster mode disabled. After you migrate all Valkey or Redis OSS clients to use cluster mode enabled, you can then complete cluster mode configuration and set the cluster mode to Enabled.</p>
        durability: <p>Specifies the durability setting for the replication group. Use this parameter to change the durability mode of an existing replication group, for example from <code>sync</code> to <code>async</code> or vice versa. For more information, see <a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/durability.html">Durability</a>.</p>

    Raises:
        capo_elasticache.errors.cache_cluster_not_found_fault.CacheClusterNotFoundFault: <p>The requested cluster ID does not refer to an existing cluster.</p>
        capo_elasticache.errors.cache_parameter_group_not_found_fault.CacheParameterGroupNotFoundFault: <p>The requested cache parameter group name does not refer to an existing cache parameter group.</p>
        capo_elasticache.errors.cache_security_group_not_found_fault.CacheSecurityGroupNotFoundFault: <p>The requested cache security group name does not refer to an existing cache security group.</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_cache_security_group_state_fault.InvalidCacheSecurityGroupStateFault: <p>The current state of the cache security group does not allow deletion.</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_user_group_state_fault.InvalidUserGroupStateFault: <p>The user group is not in an active 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_quota_for_cluster_exceeded_fault.NodeQuotaForClusterExceededFault: <p>The request cannot be processed because it would exceed the allowed number of cache nodes in a single cluster.</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.replication_group_not_found_fault.ReplicationGroupNotFoundFault: <p>The specified replication group does not exist.</p>
        capo_elasticache.errors.user_group_not_found_fault.UserGroupNotFoundFault: <p>The user group was not found or does not exist</p>
        capo_elasticache.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        ModifyReplicationGroup

        >>> client.modify_replication_group(replication_group_id='my-redis-rg', replication_group_description='Modified replication group', snapshotting_cluster_id='my-redis-rg-001', apply_immediately=True, snapshot_retention_limit=30)
    """

    def _handler(
        req: "OperationRequest[capo_elasticache.types.modify_replication_group_message.ModifyReplicationGroupMessage]",
    ) -> OperationResponse[
        "capo_elasticache.types.modify_replication_group_result.ModifyReplicationGroupResult"
    ]:
        import capo_elasticache._operations.amazon_elasti_cache_v9.modify_replication_group

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyReplicationGroup")
    )
    input_: capo_elasticache.types.modify_replication_group_message.ModifyReplicationGroupMessage = {}
    if replication_group_id is not None:
        input_["replication_group_id"] = replication_group_id
    if replication_group_description is not None:
        input_["replication_group_description"] = replication_group_description
    if primary_cluster_id is not None:
        input_["primary_cluster_id"] = primary_cluster_id
    if snapshotting_cluster_id is not None:
        input_["snapshotting_cluster_id"] = snapshotting_cluster_id
    if automatic_failover_enabled is not None:
        input_["automatic_failover_enabled"] = automatic_failover_enabled
    if multi_az_enabled is not None:
        input_["multi_az_enabled"] = multi_az_enabled
    if node_group_id is not None:
        input_["node_group_id"] = node_group_id
    if cache_security_group_names is not None:
        input_["cache_security_group_names"] = cache_security_group_names
    if security_group_ids is not None:
        input_["security_group_ids"] = security_group_ids
    if preferred_maintenance_window is not None:
        input_["preferred_maintenance_window"] = preferred_maintenance_window
    if notification_topic_arn is not None:
        input_["notification_topic_arn"] = notification_topic_arn
    if cache_parameter_group_name is not None:
        input_["cache_parameter_group_name"] = cache_parameter_group_name
    if notification_topic_status is not None:
        input_["notification_topic_status"] = notification_topic_status
    if apply_immediately is not None:
        input_["apply_immediately"] = apply_immediately
    if engine is not None:
        input_["engine"] = engine
    if engine_version is not None:
        input_["engine_version"] = engine_version
    if auto_minor_version_upgrade is not None:
        input_["auto_minor_version_upgrade"] = auto_minor_version_upgrade
    if snapshot_retention_limit is not None:
        input_["snapshot_retention_limit"] = snapshot_retention_limit
    if snapshot_window is not None:
        input_["snapshot_window"] = snapshot_window
    if cache_node_type is not None:
        input_["cache_node_type"] = cache_node_type
    if auth_token is not None:
        input_["auth_token"] = auth_token
    if auth_token_update_strategy is not None:
        input_["auth_token_update_strategy"] = auth_token_update_strategy
    if user_group_ids_to_add is not None:
        input_["user_group_ids_to_add"] = user_group_ids_to_add
    if user_group_ids_to_remove is not None:
        input_["user_group_ids_to_remove"] = user_group_ids_to_remove
    if remove_user_groups is not None:
        input_["remove_user_groups"] = remove_user_groups
    if log_delivery_configurations is not None:
        input_["log_delivery_configurations"] = log_delivery_configurations
    if ip_discovery is not None:
        input_["ip_discovery"] = ip_discovery
    if transit_encryption_enabled is not None:
        input_["transit_encryption_enabled"] = transit_encryption_enabled
    if transit_encryption_mode is not None:
        input_["transit_encryption_mode"] = transit_encryption_mode
    if cluster_mode is not None:
        input_["cluster_mode"] = cluster_mode
    if durability is not None:
        input_["durability"] = durability

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