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.
-
Scaling for Valkey or Redis OSS (cluster mode enabled) in the ElastiCache User Guide
-
ModifyReplicationGroupShardConfiguration in the ElastiCache API Reference
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
dddare:-
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
ApplyImmediatelyparameter is specified astruefor 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 thePreferredMaintenanceWindowsetting 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|falseDefault:
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
SnapshotRetentionLimitto 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:00If 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-strategyparameter. 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-tokenparameter. 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
TransitEncryptionModetopreferred. -
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
TransitEncryptionEnabledtotrue, for your existing cluster, and setTransitEncryptionModetopreferredin 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 torequiredto allow encrypted connections only.Setting
TransitEncryptionModetorequiredis a two-step process that requires you to first set theTransitEncryptionModetopreferred, after that you can setTransitEncryptionModetorequired. -
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
synctoasyncor vice versa. For more information, see Durability.
Raises:
-
CacheClusterNotFoundFault–The requested cluster ID does not refer to an existing cluster.
-
CacheParameterGroupNotFoundFault–The requested cache parameter group name does not refer to an existing cache parameter group.
-
CacheSecurityGroupNotFoundFault–The requested cache security group name does not refer to an existing cache security group.
-
InsufficientCacheClusterCapacityFault–The requested cache node type is not available in the specified Availability Zone. For more information, see InsufficientCacheClusterCapacity in the ElastiCache User Guide.
-
InvalidCacheClusterStateFault–The requested cluster is not in the
availablestate. -
InvalidCacheSecurityGroupStateFault–The current state of the cache security group does not allow deletion.
-
InvalidKMSKeyFault–The KMS key supplied is not valid.
-
InvalidParameterCombinationException–Two or more incompatible parameters were specified.
-
InvalidParameterValueException–The value for a parameter is invalid.
-
InvalidReplicationGroupStateFault–The requested replication group is not in the
availablestate. -
InvalidUserGroupStateFault–The user group is not in an active state.
-
InvalidVPCNetworkStateFault–The VPC network is in an invalid state.
-
NodeQuotaForClusterExceededFault–The request cannot be processed because it would exceed the allowed number of cache nodes in a single cluster.
-
NodeQuotaForCustomerExceededFault–The request cannot be processed because it would exceed the allowed number of cache nodes per customer.
-
ReplicationGroupNotFoundFault–The specified replication group does not exist.
-
UserGroupNotFoundFault–The user group was not found or does not exist
-
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)
Source code in docs_src/capo_elasticache/_services/elasti_cache.py
5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 | |