import { Command as $Command } from "@smithy/smithy-client"; import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { ElastiCacheClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ElastiCacheClient"; import type { CreateReplicationGroupMessage, CreateReplicationGroupResult } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link CreateReplicationGroupCommand}. */ export interface CreateReplicationGroupCommandInput extends CreateReplicationGroupMessage { } /** * @public * * The output of {@link CreateReplicationGroupCommand}. */ export interface CreateReplicationGroupCommandOutput extends CreateReplicationGroupResult, __MetadataBearer { } declare const CreateReplicationGroupCommand_base: { new (input: CreateReplicationGroupCommandInput): import("@smithy/smithy-client").CommandImpl; new (input: CreateReplicationGroupCommandInput): import("@smithy/smithy-client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions; }; /** *

Creates a Valkey or Redis OSS (cluster mode disabled) or a Valkey or Redis OSS (cluster mode enabled) replication * group.

*

This API can be used to create a standalone regional replication group or a secondary * replication group associated with a Global datastore.

*

A Valkey or Redis OSS (cluster mode disabled) replication group is a collection of nodes, where * one of the nodes is a read/write primary and the others are read-only replicas. * Writes to the primary are asynchronously propagated to the replicas.

*

A Valkey or Redis OSS cluster-mode enabled cluster is comprised of from 1 to 90 shards (API/CLI: * node groups). Each shard has a primary node and up to 5 read-only replica nodes. The * configuration can range from 90 shards and 0 replicas to 15 shards and 5 replicas, which * is the maximum number or replicas allowed.

*

The node or shard limit can be increased to a maximum of 500 per cluster if the Valkey or Redis OSS * engine version is 5.0.6 or higher. For example, you can choose to configure a 500 node * cluster that ranges between 83 shards (one primary and 5 replicas per shard) and 500 * shards (single primary and no replicas). Make sure there are enough available IP * addresses to accommodate the increase. Common pitfalls include the subnets in the subnet * group have too small a CIDR range or the subnets are shared and heavily used by other * clusters. For more information, see Creating a Subnet * Group. For versions below 5.0.6, the limit is 250 per cluster.

*

To request a limit increase, see Amazon Service Limits and * choose the limit type Nodes per cluster per instance * type.

*

When a Valkey or Redis OSS (cluster mode disabled) replication group has been successfully created, * you can add one or more read replicas to it, up to a total of 5 read replicas. If you * need to increase or decrease the number of node groups (console: shards), you can use scaling. * For more information, see Scaling self-designed clusters in the ElastiCache User * Guide.

* *

This operation is valid for Valkey and Redis OSS only.

*
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { ElastiCacheClient, CreateReplicationGroupCommand } from "@aws-sdk/client-elasticache"; // ES Modules import * // const { ElastiCacheClient, CreateReplicationGroupCommand } = require("@aws-sdk/client-elasticache"); // CommonJS import * // import type { ElastiCacheClientConfig } from "@aws-sdk/client-elasticache"; * const config = {}; // type is ElastiCacheClientConfig * const client = new ElastiCacheClient(config); * const input = { // CreateReplicationGroupMessage * ReplicationGroupId: "STRING_VALUE", // required * ReplicationGroupDescription: "STRING_VALUE", // required * GlobalReplicationGroupId: "STRING_VALUE", * PrimaryClusterId: "STRING_VALUE", * AutomaticFailoverEnabled: true || false, * MultiAZEnabled: true || false, * NumCacheClusters: Number("int"), * PreferredCacheClusterAZs: [ // AvailabilityZonesList * "STRING_VALUE", * ], * NumNodeGroups: Number("int"), * ReplicasPerNodeGroup: Number("int"), * NodeGroupConfiguration: [ // NodeGroupConfigurationList * { // NodeGroupConfiguration * NodeGroupId: "STRING_VALUE", * Slots: "STRING_VALUE", * ReplicaCount: Number("int"), * PrimaryAvailabilityZone: "STRING_VALUE", * ReplicaAvailabilityZones: [ * "STRING_VALUE", * ], * PrimaryOutpostArn: "STRING_VALUE", * ReplicaOutpostArns: [ // OutpostArnsList * "STRING_VALUE", * ], * }, * ], * CacheNodeType: "STRING_VALUE", * Engine: "STRING_VALUE", * EngineVersion: "STRING_VALUE", * CacheParameterGroupName: "STRING_VALUE", * CacheSubnetGroupName: "STRING_VALUE", * CacheSecurityGroupNames: [ // CacheSecurityGroupNameList * "STRING_VALUE", * ], * SecurityGroupIds: [ // SecurityGroupIdsList * "STRING_VALUE", * ], * Tags: [ // TagList * { // Tag * Key: "STRING_VALUE", * Value: "STRING_VALUE", * }, * ], * SnapshotArns: [ // SnapshotArnsList * "STRING_VALUE", * ], * SnapshotName: "STRING_VALUE", * PreferredMaintenanceWindow: "STRING_VALUE", * Port: Number("int"), * NotificationTopicArn: "STRING_VALUE", * AutoMinorVersionUpgrade: true || false, * SnapshotRetentionLimit: Number("int"), * SnapshotWindow: "STRING_VALUE", * AuthToken: "STRING_VALUE", * TransitEncryptionEnabled: true || false, * AtRestEncryptionEnabled: true || false, * KmsKeyId: "STRING_VALUE", * UserGroupIds: [ // UserGroupIdListInput * "STRING_VALUE", * ], * LogDeliveryConfigurations: [ // LogDeliveryConfigurationRequestList * { // LogDeliveryConfigurationRequest * LogType: "slow-log" || "engine-log", * DestinationType: "cloudwatch-logs" || "kinesis-firehose", * DestinationDetails: { // DestinationDetails * CloudWatchLogsDetails: { // CloudWatchLogsDestinationDetails * LogGroup: "STRING_VALUE", * }, * KinesisFirehoseDetails: { // KinesisFirehoseDestinationDetails * DeliveryStream: "STRING_VALUE", * }, * }, * LogFormat: "text" || "json", * Enabled: true || false, * }, * ], * DataTieringEnabled: true || false, * NetworkType: "ipv4" || "ipv6" || "dual_stack", * IpDiscovery: "ipv4" || "ipv6", * TransitEncryptionMode: "preferred" || "required", * ClusterMode: "enabled" || "disabled" || "compatible", * ServerlessCacheSnapshotName: "STRING_VALUE", * }; * const command = new CreateReplicationGroupCommand(input); * const response = await client.send(command); * // { // CreateReplicationGroupResult * // ReplicationGroup: { // ReplicationGroup * // ReplicationGroupId: "STRING_VALUE", * // Description: "STRING_VALUE", * // GlobalReplicationGroupInfo: { // GlobalReplicationGroupInfo * // GlobalReplicationGroupId: "STRING_VALUE", * // GlobalReplicationGroupMemberRole: "STRING_VALUE", * // }, * // Status: "STRING_VALUE", * // PendingModifiedValues: { // ReplicationGroupPendingModifiedValues * // PrimaryClusterId: "STRING_VALUE", * // AutomaticFailoverStatus: "enabled" || "disabled", * // Resharding: { // ReshardingStatus * // SlotMigration: { // SlotMigration * // ProgressPercentage: Number("double"), * // }, * // }, * // AuthTokenStatus: "SETTING" || "ROTATING", * // UserGroups: { // UserGroupsUpdateStatus * // UserGroupIdsToAdd: [ // UserGroupIdList * // "STRING_VALUE", * // ], * // UserGroupIdsToRemove: [ * // "STRING_VALUE", * // ], * // }, * // LogDeliveryConfigurations: [ // PendingLogDeliveryConfigurationList * // { // PendingLogDeliveryConfiguration * // LogType: "slow-log" || "engine-log", * // DestinationType: "cloudwatch-logs" || "kinesis-firehose", * // DestinationDetails: { // DestinationDetails * // CloudWatchLogsDetails: { // CloudWatchLogsDestinationDetails * // LogGroup: "STRING_VALUE", * // }, * // KinesisFirehoseDetails: { // KinesisFirehoseDestinationDetails * // DeliveryStream: "STRING_VALUE", * // }, * // }, * // LogFormat: "text" || "json", * // }, * // ], * // TransitEncryptionEnabled: true || false, * // TransitEncryptionMode: "preferred" || "required", * // ClusterMode: "enabled" || "disabled" || "compatible", * // }, * // MemberClusters: [ // ClusterIdList * // "STRING_VALUE", * // ], * // NodeGroups: [ // NodeGroupList * // { // NodeGroup * // NodeGroupId: "STRING_VALUE", * // Status: "STRING_VALUE", * // PrimaryEndpoint: { // Endpoint * // Address: "STRING_VALUE", * // Port: Number("int"), * // }, * // ReaderEndpoint: { * // Address: "STRING_VALUE", * // Port: Number("int"), * // }, * // Slots: "STRING_VALUE", * // NodeGroupMembers: [ // NodeGroupMemberList * // { // NodeGroupMember * // CacheClusterId: "STRING_VALUE", * // CacheNodeId: "STRING_VALUE", * // ReadEndpoint: { * // Address: "STRING_VALUE", * // Port: Number("int"), * // }, * // PreferredAvailabilityZone: "STRING_VALUE", * // PreferredOutpostArn: "STRING_VALUE", * // CurrentRole: "STRING_VALUE", * // }, * // ], * // }, * // ], * // SnapshottingClusterId: "STRING_VALUE", * // AutomaticFailover: "enabled" || "disabled" || "enabling" || "disabling", * // MultiAZ: "enabled" || "disabled", * // ConfigurationEndpoint: "", * // SnapshotRetentionLimit: Number("int"), * // SnapshotWindow: "STRING_VALUE", * // ClusterEnabled: true || false, * // CacheNodeType: "STRING_VALUE", * // AuthTokenEnabled: true || false, * // AuthTokenLastModifiedDate: new Date("TIMESTAMP"), * // TransitEncryptionEnabled: true || false, * // AtRestEncryptionEnabled: true || false, * // MemberClustersOutpostArns: [ // ReplicationGroupOutpostArnList * // "STRING_VALUE", * // ], * // KmsKeyId: "STRING_VALUE", * // ARN: "STRING_VALUE", * // UserGroupIds: [ * // "STRING_VALUE", * // ], * // LogDeliveryConfigurations: [ // LogDeliveryConfigurationList * // { // LogDeliveryConfiguration * // LogType: "slow-log" || "engine-log", * // DestinationType: "cloudwatch-logs" || "kinesis-firehose", * // DestinationDetails: { * // CloudWatchLogsDetails: { * // LogGroup: "STRING_VALUE", * // }, * // KinesisFirehoseDetails: { * // DeliveryStream: "STRING_VALUE", * // }, * // }, * // LogFormat: "text" || "json", * // Status: "active" || "enabling" || "modifying" || "disabling" || "error", * // Message: "STRING_VALUE", * // }, * // ], * // ReplicationGroupCreateTime: new Date("TIMESTAMP"), * // DataTiering: "enabled" || "disabled", * // AutoMinorVersionUpgrade: true || false, * // NetworkType: "ipv4" || "ipv6" || "dual_stack", * // IpDiscovery: "ipv4" || "ipv6", * // TransitEncryptionMode: "preferred" || "required", * // ClusterMode: "enabled" || "disabled" || "compatible", * // Engine: "STRING_VALUE", * // }, * // }; * * ``` * * @param CreateReplicationGroupCommandInput - {@link CreateReplicationGroupCommandInput} * @returns {@link CreateReplicationGroupCommandOutput} * @see {@link CreateReplicationGroupCommandInput} for command's `input` shape. * @see {@link CreateReplicationGroupCommandOutput} for command's `response` shape. * @see {@link ElastiCacheClientResolvedConfig | config} for ElastiCacheClient's `config` shape. * * @throws {@link CacheClusterNotFoundFault} (client fault) *

The requested cluster ID does not refer to an existing cluster.

* * @throws {@link CacheParameterGroupNotFoundFault} (client fault) *

The requested cache parameter group name does not refer to an existing cache parameter * group.

* * @throws {@link CacheSecurityGroupNotFoundFault} (client fault) *

The requested cache security group name does not refer to an existing cache security * group.

* * @throws {@link CacheSubnetGroupNotFoundFault} (client fault) *

The requested cache subnet group name does not refer to an existing cache subnet * group.

* * @throws {@link ClusterQuotaForCustomerExceededFault} (client fault) *

The request cannot be processed because it would exceed the allowed number of clusters * per customer.

* * @throws {@link GlobalReplicationGroupNotFoundFault} (client fault) *

The Global datastore does not exist

* * @throws {@link InsufficientCacheClusterCapacityFault} (client fault) *

The requested cache node type is not available in the specified Availability Zone. For * more information, see InsufficientCacheClusterCapacity in the ElastiCache User Guide.

* * @throws {@link InvalidCacheClusterStateFault} (client fault) *

The requested cluster is not in the available state.

* * @throws {@link InvalidGlobalReplicationGroupStateFault} (client fault) *

The Global datastore is not available or in primary-only state.

* * @throws {@link InvalidParameterCombinationException} (client fault) *

Two or more incompatible parameters were specified.

* * @throws {@link InvalidParameterValueException} (client fault) *

The value for a parameter is invalid.

* * @throws {@link InvalidUserGroupStateFault} (client fault) *

The user group is not in an active state.

* * @throws {@link InvalidVPCNetworkStateFault} (client fault) *

The VPC network is in an invalid state.

* * @throws {@link NodeGroupsPerReplicationGroupQuotaExceededFault} (client fault) *

The request cannot be processed because it would exceed the maximum allowed number of * node groups (shards) in a single replication group. The default maximum is 90

* * @throws {@link NodeQuotaForClusterExceededFault} (client fault) *

The request cannot be processed because it would exceed the allowed number of cache * nodes in a single cluster.

* * @throws {@link NodeQuotaForCustomerExceededFault} (client fault) *

The request cannot be processed because it would exceed the allowed number of cache * nodes per customer.

* * @throws {@link ReplicationGroupAlreadyExistsFault} (client fault) *

The specified replication group already exists.

* * @throws {@link TagQuotaPerResourceExceeded} (client fault) *

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.

* * @throws {@link UserGroupNotFoundFault} (client fault) *

The user group was not found or does not exist

* * @throws {@link ElastiCacheServiceException} *

Base exception class for all service exceptions from ElastiCache service.

* * * @example CreateCacheReplicationGroup * ```javascript * // Creates a Redis replication group with 3 nodes. * const input = { * AutomaticFailoverEnabled: true, * CacheNodeType: "cache.m3.medium", * Engine: "redis", * EngineVersion: "2.8.24", * NumCacheClusters: 3, * ReplicationGroupDescription: "A Redis replication group.", * ReplicationGroupId: "my-redis-rg", * SnapshotRetentionLimit: 30 * }; * const command = new CreateReplicationGroupCommand(input); * const response = await client.send(command); * /* response is * { * ReplicationGroup: { * AutomaticFailover: "enabling", * Description: "A Redis replication group.", * MemberClusters: [ * "my-redis-rg-001", * "my-redis-rg-002", * "my-redis-rg-003" * ], * PendingModifiedValues: { /* empty *\/ }, * ReplicationGroupId: "my-redis-rg", * SnapshottingClusterId: "my-redis-rg-002", * Status: "creating" * } * } * *\/ * ``` * * @example CreateReplicationGroup * ```javascript * // Creates a Redis (cluster mode enabled) replication group with two shards. One shard has one read replica node and the other shard has two read replicas. * const input = { * AutoMinorVersionUpgrade: true, * CacheNodeType: "cache.m3.medium", * CacheParameterGroupName: "default.redis3.2.cluster.on", * Engine: "redis", * EngineVersion: "3.2.4", * NodeGroupConfiguration: [ * { * PrimaryAvailabilityZone: "us-east-1c", * ReplicaAvailabilityZones: [ * "us-east-1b" * ], * ReplicaCount: 1, * Slots: "0-8999" * }, * { * PrimaryAvailabilityZone: "us-east-1a", * ReplicaAvailabilityZones: [ * "us-east-1a", * "us-east-1c" * ], * ReplicaCount: 2, * Slots: "9000-16383" * } * ], * NumNodeGroups: 2, * ReplicationGroupDescription: "A multi-sharded replication group", * ReplicationGroupId: "clustered-redis-rg", * SnapshotRetentionLimit: 8 * }; * const command = new CreateReplicationGroupCommand(input); * const response = await client.send(command); * /* response is * { * ReplicationGroup: { * AutomaticFailover: "enabled", * Description: "Sharded replication group", * MemberClusters: [ * "rc-rg3-0001-001", * "rc-rg3-0001-002", * "rc-rg3-0002-001", * "rc-rg3-0002-002", * "rc-rg3-0002-003" * ], * PendingModifiedValues: { /* empty *\/ }, * ReplicationGroupId: "clustered-redis-rg", * SnapshotRetentionLimit: 8, * SnapshotWindow: "05:30-06:30", * Status: "creating" * } * } * *\/ * ``` * * @public */ export declare class CreateReplicationGroupCommand extends CreateReplicationGroupCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: CreateReplicationGroupMessage; output: CreateReplicationGroupResult; }; sdk: { input: CreateReplicationGroupCommandInput; output: CreateReplicationGroupCommandOutput; }; }; }