gcloud redis instances create Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud redis instances create - create a Memorystore Redis instance
- SYNOPSIS
gcloud redis instances create(INSTANCE:--region=REGION)[--alternative-zone=ALTERNATIVE_ZONE][--async][--connect-mode=CONNECT_MODE][--customer-managed-key=CUSTOMER_MANAGED_KEY][--display-name=DISPLAY_NAME][--enable-auth][--labels=[KEY=VALUE,…]][--maintenance-window-day=MAINTENANCE_WINDOW_DAY][--maintenance-window-hour=MAINTENANCE_WINDOW_HOUR][--network=NETWORK; default="default"][--persistence-mode=PERSISTENCE_MODE][--rdb-snapshot-period=RDB_SNAPSHOT_PERIOD][--rdb-snapshot-start-time=RDB_SNAPSHOT_START_TIME][--read-replicas-mode=READ_REPLICAS_MODE][--redis-config=[KEY=VALUE,…]][--redis-version=VERSION][--replica-count=REPLICA_COUNT][--reserved-ip-range=RESERVED_IP_RANGE][--size=SIZE; default=1][--tier=TIER; default="basic"][--transit-encryption-mode=TRANSIT_ENCRYPTION_MODE][--zone=ZONE][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
- Create a new Redis instance.
This command can fail for the following reasons:
- An instance with the same name already exists.
- The active account does not have permission to create instances.
- EXAMPLES
- To create a basic tier instance with the name
my-redis-instanceinregionus-central-1with memory size of 5 GiB, run:gcloudredisinstancescreatemy-redis-instance--region=us-central1--size=5 - POSITIONAL ARGUMENTS
- Instance resource - Arguments and flags that specify the Memorystore Redisinstance you want to create. 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
instanceon the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
INSTANCE- ID of the instance or fully qualified identifier for the instance.
To set the
instanceattribute:- provide the argument
instanceon 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 instance. Overrides the default redis/regionproperty value for this command invocation.To set the
regionattribute:- provide the argument
instanceon 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
- Instance resource - Arguments and flags that specify the Memorystore Redisinstance you want to create. 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
--alternative-zone=ALTERNATIVE_ZONE- A secondary zone for the Redis instance. Only applicable to the standard tier.This protects the instance against zonal failures by provisioning it across twozones. If provided, alternative zone must be a different zone from the oneprovided through
--zone. --async- Return immediately, without waiting for the operation in progress to complete.
--connect-mode=CONNECT_MODE- Network connection mode used by instances.
CONNECT_MODEmust be one of:connect-mode-unspecified,direct-peering,private-service-access. --customer-managed-key=CUSTOMER_MANAGED_KEY- The KMS key reference that you want to use to encrypt the data at rest for thisRedis instance. If this is provided, CMEK is enabled.
--display-name=DISPLAY_NAME- A human-readable name for the instance.
--enable-auth- Enables Redis AUTH for the instance. If omitted AUTH is disabled.
--labels=[KEY=VALUE,…]- List of label KEY=VALUE pairs to add.
Keys must start with a lowercase character and contain only hyphens(
-), underscores (_), lowercase characters, andnumbers. Values must contain only hyphens (-), underscores(_), lowercase characters, and numbers. --maintenance-window-day=MAINTENANCE_WINDOW_DAY- Day of week for maintenance window, in UTC time zone. MAINTENANCE_WINDOW_DAYmust be one of: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY.
MAINTENANCE_WINDOW_DAYmust be one of:day-of-week-unspecified,friday,monday,saturday,sunday,thursday,tuesday,wednesday. --maintenance-window-hour=MAINTENANCE_WINDOW_HOUR- Hour of day (0 to 23) for maintenance window, in UTC time zone.
--network=NETWORK; default="default"- The name of the Google Compute Engine network to which the instance will beconnected. If left unspecified, the default network will be used.
--persistence-mode=PERSISTENCE_MODE- Operation mode for automated persistence.
PERSISTENCE_MODEmust be one of:disabled- RDB mode is disabled
rdb- Automatic RDB persistence
--rdb-snapshot-period=RDB_SNAPSHOT_PERIOD- Attempted period between RDB snapshots.
RDB_SNAPSHOT_PERIODmust be one of:12h- 12 hours
1h- 1 hour
24h- 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, 2022-11-02T03:00:00Z.
--read-replicas-mode=READ_REPLICAS_MODE- Read replicas mode used by the instance. Only works against standard tierinstances with 5GB and above provisioned capacity.
READ_REPLICAS_MODEmust be one of:read-replicas-disabled- Read replica is disabled for the instance. Read endpoint will not be providedand the instance cannot scale up or down the number of replicas.
read-replicas-enabled- Read replica is enabled for the instance. Read endpoint will be provided and theinstance can scale up and down the number of replicas.
--redis-config=[KEY=VALUE,…]- A list of Redis config KEY=VALUE pairs to set on the instance according tohttp://redis.io/topics/config.Currently, the only supported parameters are:
Redis version 3.2 and newer: maxmemory-policy, notify-keyspace-events, timeout,databases.
Redis version 4.0 and newer: activedefrag, lfu-decay-time, lfu-log-factor,maxmemory-gb.
Redis version 5.0 and newer: stream-node-max-bytes, stream-node-max-entries.
--redis-version=VERSION- The version of Redis software.
VERSIONmust be one of:redis_3_2- Redis 3.2 compatibility
redis_4_0- Redis 4.0 compatibility
redis_5_0- Redis 5.0 compatibility
redis_6_x- Redis 6.x compatibility
redis_7_0- Redis 7.0 compatibility
redis_7_2- Redis 7.2 compatibility
--replica-count=REPLICA_COUNT- The replica count of the instance.
--reserved-ip-range=RESERVED_IP_RANGE- For DIRECT_PEERING mode, the CIDR range of internal addresses that are reservedfor this instance. Range must be unique and non-overlapping with existingsubnets in an authorized network. For PRIVATE_SERVICE_ACCESS mode, the name ofan IP address range allocated for the private service access connection. If notprovided, the service will choose an unused /29 block, for example, 10.0.0.0/29or 192.168.0.0/29. If READ_REPLICAS_ENABLED is used for the --read-replicas-modeflag, then the block size required for this flag is /28.
--size=SIZE; default=1- The memory size of the instance in GiB. If not provided, size of 1 GiB will beused.
--tier=TIER; default="basic"- The service tier of the instance.
TIERmust be one of:basic- Basic Redis instance with no replication
standard- Standard high-availability Redis instance with replication
--transit-encryption-mode=TRANSIT_ENCRYPTION_MODE- Transit encryption mode used by the instance.
TRANSIT_ENCRYPTION_MODEmust be one of:disabled- Transit encryption is disabled for the instance.
server-authentication- Client to Server traffic encryption enabled with server authentication.
--zone=ZONE- The zone of the Redis instance. If not provided the service will pick a randomzone in the region. For the standard tier, instances will be created across twozones for protection against zonal failures. So if --alternative-zone is alsoprovided, it must be different from --zone.
- 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/v1API. The full documentation for thisAPI can be found at:https://cloud.google.com/memorystore/docs/redis/ - NOTES
- These variants are also available:
gcloudalpharedisinstancescreategcloudbetaredisinstancescreate
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-05-07 UTC.