create_snapshot
¶
create_snapshot(
*,
config_overrides: Optional[ElastiCacheClientConfig] = None,
replication_group_id: Optional[String] = None,
cache_cluster_id: Optional[String] = None,
snapshot_name: Optional[String] = None,
kms_key_id: Optional[String] = None,
tags: Optional[TagList] = None,
) -> CreateSnapshotResult
Creates a copy of an entire cluster or replication group at a specific moment in time.
This operation is valid for Valkey or Redis OSS only.
Parameters:
-
replication_group_id(Optional[String], default:None) –The identifier of an existing replication group. The snapshot is created from this replication group.
-
cache_cluster_id(Optional[String], default:None) –The identifier of an existing cluster. The snapshot is created from this cluster.
-
snapshot_name(Optional[String], default:None) –A name for the snapshot being created. This value is stored as a lowercase string.
-
kms_key_id(Optional[String], default:None) –The ID of the KMS key used to encrypt the snapshot.
-
tags(Optional[TagList], default:None) –A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.
Raises:
-
CacheClusterNotFoundFault–The requested cluster ID does not refer to an existing cluster.
-
InvalidCacheClusterStateFault–The requested cluster is not in the
availablestate. -
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. -
ReplicationGroupNotFoundFault–The specified replication group does not exist.
-
SnapshotAlreadyExistsFault–You already have a snapshot with the given name.
-
SnapshotFeatureNotSupportedFault–You attempted one of the following operations:
-
Creating a snapshot of a Valkey or Redis OSS cluster running on a
cache.t1.microcache node. -
Creating a snapshot of a cluster that is running Memcached rather than Valkey or Redis OSS.
Neither of these are supported by ElastiCache.
-
-
SnapshotQuotaExceededFault–The request cannot be processed because it would exceed the maximum number of snapshots.
-
TagQuotaPerResourceExceeded–The request cannot be processed because it would cause the resource to have more than the allowed number of tags. The maximum number of tags permitted on a resource is 50.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
CreateSnapshot - NonClustered Redis, 2 read-replicas Creates a snapshot of a non-clustered Redis cluster that has only three nodes, primary and two read-replicas. CacheClusterId must be a specific node in the cluster.
>>> client.create_snapshot(cache_cluster_id='threenoderedis-001', snapshot_name='snapshot-2')
CreateSnapshot - NonClustered Redis, no read-replicas
Creates a snapshot of a non-clustered Redis cluster that has only one node.
>>> client.create_snapshot(cache_cluster_id='onenoderedis', snapshot_name='snapshot-1')
CreateSnapshot-clustered Redis
Creates a snapshot of a clustered Redis cluster that has 2 shards, each with a primary and 4 read-replicas.
Source code in docs_src/capo_elasticache/_services/elasti_cache.py
1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 | |