This page gives instructions on common tasks for the Redis AUTH feature on Memorystore for Redis. For details on what the AUTH feature provides, see AUTH feature overview .
For a list of permissions a user needs in order to perform the AUTH tasks on this page, see Redis AUTH permissions .
Create a Redis instance with AUTH enabled
Console
When you create a Redis instance , select Enable AUTH.
gcloud
Enter the following command, replacing variables with appropriate values:
gcloud redis instances create instance-id --enable-auth --size= size --region= region --zone= zone --redis-version= version
Enable and disable AUTH on an existing Redis instance
Console
-
Go to the Memorystore for Redispage in the Google Cloud console.
-
View your instance's Instance details page by clicking on your Instance ID .
-
Click the Editbutton.
-
Find the AUTH section.
-
If you want to enable AUTH, select checkbox labeled Enable AUTH.
-
If you want to disable AUTH, deselect the checkbox labeled Enable AUTH.
-
-
Click the Savebutton.
gcloud
-
Enable AUTH for your instance by running the following command, replacing variables with appropriate values:
gcloud redis instances update instance-id --enable-auth --region= region
-
Disable AUTH for your instance by running the following command, replacing variables with appropriate values:
gcloud redis instances update instance-id --no-enable-auth --region= region
Get the AUTH string
Console
-
Go to the Memorystore for Redispage in the Google Cloud console.
-
View your instance's Instance details page by clicking on your Instance ID .
-
Find the AUTH stringvalue in the Securitysection.
gcloud
-
Get the AUTH string by copying it from the response body returned by the following command:
gcloud redis instances get-auth-string instance-id --region= region
Change the AUTH string
Follow the steps below to change the AUTH string to a new value:
-
Disable AUTH:
gcloud redis instances update instance-id --no-enable-auth --region= region
-
Enable AUTH:
gcloud redis instances update instance-id --enable-auth --region= region
-
Get the new AUTH string:
gcloud redis instances get-auth-string instance-id --region= region
-
In your application, replace the old AUTH string with the new AUTH string and reconnect your client.
Connect to a Redis instance with AUTH
To use AUTH and redis-cli
to connect to your instance, see Connect to a Redis instance that uses AUTH
.
What's next
- View the AUTH feature overview .

