Managing Redis AUTH

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.

Creating a Redis instance with AUTH enabled

Console

Select Enable AUTH when Creating a Redis instance.

gcloud

Enter the following command, replacing variables with appropriate values:

gcloud beta redis instances create instance-id --enable-auth --size=size --region=region --zone=zone --redis-version=version

Enabling/disabling AUTH on an existing Redis instance

Console

  1. Go to the Memorystore for Redis page in the Cloud Console.

    Memorystore for Redis

  2. View your instance's Instance details page by clicking on your Instance ID.

  3. Click the Edit button.

  4. 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.

  5. Click the Save button.

gcloud

  1. Enable AUTH for your instance by running the following command, replacing variables with appropriate values:

    gcloud beta redis instances update instance-id --enable-auth --region=region
    
  2. Disable AUTH for your instance by running the following command, replacing variables with appropriate values:

    gcloud beta redis instances update instance-id --no-enable-auth --region=region
    

Getting the AUTH string

Console

  1. Go to the Memorystore for Redis page in the Cloud Console.

    Memorystore for Redis

  2. View your instance's Instance details page by clicking on your Instance ID.

  3. Find the AUTH string value under Instance Properties.

gcloud

  1. Get the AUTH string by copying it from the response body returned by the following command:

    gcloud beta redis instances get-auth-string instance-id --region=region
    

Changing the AUTH string

Follow the steps below to change the AUTH string to a new value:

  1. Disable AUTH:

    gcloud beta redis instances update instance-id --no-enable-auth --region=region
    
  2. Enable AUTH:

    gcloud beta redis instances update instance-id --enable-auth --region=region
    
  3. Get the new AUTH string:

    gcloud beta redis instances get-auth-string instance-id --region=region
    
  4. In your application, replace the old AUTH string with the new AUTH string and reconnect your client.

Connecting to a Redis instance with AUTH

To use AUTH and redis-cli to connect to your instance, see Connecting to a Redis instance that uses AUTH.

What's next