gcloud alpha redis clusters create Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha redis clusters create - create a new Memorystore for Redis Cluster instance
- SYNOPSIS
gcloud alpha redis clusters create(CLUSTER:--region=REGION)[--aof-append-fsync=AOF_APPEND_FSYNC][--async][--auth-mode=AUTH_MODE][--automated-backup-mode=AUTOMATED_BACKUP_MODE][--automated-backup-start-time=AUTOMATED_BACKUP_START_TIME][--automated-backup-ttl=AUTOMATED_BACKUP_TTL][--cross-cluster-replication-role=CROSS_CLUSTER_REPLICATION_ROLE][--deletion-protection][--kms-key=KMS_KEY][--maintenance-window-day=MAINTENANCE_WINDOW_DAY][--maintenance-window-hour=MAINTENANCE_WINDOW_HOUR][--network=NETWORK][--node-type=NODE_TYPE][--persistence-mode=PERSISTENCE_MODE][--primary-cluster=PRIMARY_CLUSTER][--rdb-snapshot-period=RDB_SNAPSHOT_PERIOD][--rdb-snapshot-start-time=RDB_SNAPSHOT_START_TIME][--redis-config=[KEY=VALUE,…]][--replica-count=REPLICA_COUNT][--shard-count=SHARD_COUNT][--transit-encryption-mode=TRANSIT_ENCRYPTION_MODE][--zone=ZONE][--zone-distribution-mode=ZONE_DISTRIBUTION_MODE][--import-gcs-object-uris=[IMPORT_GCS_OBJECT_URIS,…] |--import-managed-backup=IMPORT_MANAGED_BACKUP][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(ALPHA)Create a new Memorystore for Redis Cluster instance, anduses Private Service Connect service connectivity automation to automateconnectivity for instances.This command can fail for the following reasons:
- A cluster with the same name already exists.
- The active account does not have permission to create clusters.
- Some required APIs not enabled yet.
- No connection policy defined yet on the network and in the region a cluster willbe created.
- Miss the steps for creating and configuring a service account (to grantpermissions) in both host project and service project, if a shared VPC networkis used.
Refer tohttps://cloud.google.com/memorystore/docs/cluster/networking#prerequisites_required_before_creating_a_clusterfor prerequisites.
- EXAMPLES
- To create a cluster with name
my-redis-clusterin regionus-central1with 3 shards and with a discovery endpoint created onnetwork "default", run:gcloudalpharedisclusterscreatemy-redis-cluster--region=us-central1--shard-count=3--network=projects/NETWORK_PROJECT_ID/global/networks/default - POSITIONAL ARGUMENTS
- Cluster resource - Arguments and flags that specify the cluster you want tocreate. Your cluster ID must be 1 to 63 characters and use only lowercaseletters, numbers, or hyphens. It must start with a lowercase letter and end witha lowercase letter or number. The arguments in this group can be used to specifythe attributes of this resource. (NOTE) Some attributes are not given argumentsin this group but can be set in other ways.
To set the
projectattribute:- provide the argument
clusteron the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
CLUSTER- ID of the cluster or fully qualified identifier for the cluster.
To set the
clusterattribute:- provide the argument
clusteron the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--region=REGION- The name of the Redis region of the cluster. Overrides the default redis/regionproperty value for this command invocation.To set the
regionattribute:- provide the argument
clusteron the command line with a fullyspecified name; - provide the argument
--regionon the command line; - set the property
redis/region.
- provide the argument
- provide the argument
- Cluster resource - Arguments and flags that specify the cluster you want tocreate. Your cluster ID must be 1 to 63 characters and use only lowercaseletters, numbers, or hyphens. It must start with a lowercase letter and end witha lowercase letter or number. The arguments in this group can be used to specifythe attributes of this resource. (NOTE) Some attributes are not given argumentsin this group but can be set in other ways.
- FLAGS
--aof-append-fsync=AOF_APPEND_FSYNC- Fsync configuration.
AOF_APPEND_FSYNCmust be one of:always- Redis explicitly calls fsync for every write command.
everysec- (default) Redis explicitly calls fsync every second.
no- Redis will not explicitly call fsync.
--async- Return immediately, without waiting for the operation in progress to complete.
--auth-mode=AUTH_MODE- Available authorization mode of a Redis cluster.
AUTH_MODEmust be one of:disabled- Authorization is disabled for the cluster.
iam-auth- IAM basic authorization is enabled for the cluster.
--automated-backup-mode=AUTOMATED_BACKUP_MODE- Automated backup mode.
AUTOMATED_BACKUP_MODEmust be oneof:disabled- (default) Automated backup is disabled.
enabled- Automated backup is enabled.
--automated-backup-start-time=AUTOMATED_BACKUP_START_TIME- One-hour window when you want automated-backup operations to start. Specify thetime in the format HH:00 on a 24-hour cycle in UTC time.
--automated-backup-ttl=AUTOMATED_BACKUP_TTL- Time to live for automated backups. A backup will be deleted automatically afterthe TTL is reached. It ranges from 1 day to 365 days. For example, "10d" for 10days. If not specified, the default value is 35 days.
--cross-cluster-replication-role=CROSS_CLUSTER_REPLICATION_ROLE- The role of the cluster in cross cluster replication.
CROSS_CLUSTER_REPLICATION_ROLEmust be (only one valueis supported):secondary- Create a secondary cluster.
--deletion-protection- Enable deletion protection for the Redis Cluster. Use
--deletion-protection/--no-deletion-protectiontoenable/disable it. --kms-key=KMS_KEY- The resource name of the customer-managed encryption key (CMEK) to use for thecluster. It must use this format:projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/CRYPTO_KEY.The key must be in the same region as the cluster. Otherwise, the createoperation fails.
--maintenance-window-day=MAINTENANCE_WINDOW_DAY- Day of week when the window starts, e.g.
sunday.MAINTENANCE_WINDOW_DAYmust be one of:friday,monday,saturday,sunday,thursday,tuesday,wednesday. --maintenance-window-hour=MAINTENANCE_WINDOW_HOUR- Hour of day (
0to23) for the start of maintenancewindow, in UTC time zone. --network=NETWORK- The network used to create your instance. It must use the format:projects/NETWORK_PROJECT_ID/global/networks/NETWORK_ID. The network ID used heremust match the network ID used by the service connection policy. Otherwise, thecreate operation fails
--node-type=NODE_TYPE- Node Type of the redis cluster Node.
NODE_TYPEmust beone of:redis-highmem-medium,redis-highmem-xlarge,redis-shared-core-nano,redis-standard-small. --persistence-mode=PERSISTENCE_MODE- Operation mode for persistence.
PERSISTENCE_MODEmust beone of:aof- AOF-based persistence
disabled- Persistence mode is disabled
rdb- RDB-based persistence
--primary-cluster=PRIMARY_CLUSTER- The primary cluster that the secondary cluster will replicate from. It must usethe format: projects/PROJECT_ID/locations/REGION/clusters/CLUSTER_ID. It mustrefer to an existing cluster. Otherwise, the create operation fails.
--rdb-snapshot-period=RDB_SNAPSHOT_PERIOD- Attempted period between RDB snapshots.
RDB_SNAPSHOT_PERIODmust be one of:12h- 12 hours
1h- 1 hour
24h- (default) 24 hours
6h- 6 hours
--rdb-snapshot-start-time=RDB_SNAPSHOT_START_TIME- Date and time of the first snapshot in the ISO 1801 format, and alignment timefor future snapshots. For example, 2024-01-01T01:00:00Z. If not specified, thecurrent time will be used.
--redis-config=[KEY=VALUE,…]- A list of Redis config KEY=VALUE pairs to set on the Redis Cluster according tohttp://redis.io/topics/config.Currently the supported Redis configs are:
maxmemory-clients,maxmemory,maxmemory-policy,notify-keyspace-events,slowlog-log-slower-than,maxclients.
--replica-count=REPLICA_COUNT- The replica count of each shard.
--shard-count=SHARD_COUNT- The shard count of the cluster.
--transit-encryption-mode=TRANSIT_ENCRYPTION_MODE- Transit encryption mode used for the Redis cluster. If not provided, encryptionis disabled for the cluster.
TRANSIT_ENCRYPTION_MODEmust be one of:disabled- In-transit encryption is disabled for the cluster.
server-authentication- The cluster uses server managed encryption for in-transit encryption.
--zone=ZONE- The zone used to allocate the cluster nodes. Applicable only if thezone-distribution-mode is set to single-zone.
--zone-distribution-mode=ZONE_DISTRIBUTION_MODE- Determines how the cluster nodes are distributed across zones.
ZONE_DISTRIBUTION_MODEmust be one of:multi-zone- Allocate cluster nodes across multiple zones.
single-zone- Allocate cluster nodes in a single zone.
- At most one of these can be specified:
--import-gcs-object-uris=[IMPORT_GCS_OBJECT_URIS,…]- URIs of Google Cloud Storage objects to import from. For example,
gs://bucket/folder/file1.rdb,gs://bucket/folder/file2.rdb. --import-managed-backup=IMPORT_MANAGED_BACKUP- Managed backup to import from. For example,
projects/PROJECT_ID/locations/REGION/backupCollections/BACKUP_COLLECTION_ID/backups/BACKUP_ID.
- GCLOUD WIDE FLAGS
- These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$gcloud helpfor details. - API REFERENCE
- This command uses the
redis/v1alpha1API. The full documentationfor this API can be found at:https://cloud.google.com/memorystore/docs/redis/ - NOTES
- This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudredisclusterscreategcloudbetaredisclusterscreate
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-22 UTC.