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
Select Enable AUTH when Creating a Redis instance.
Enter the following command, replacing variables with appropriate values:
gcloud redis instances createinstance-id --enable-auth --size=size --region=region --zone=zone --redis-version=version
Enabling/disabling AUTH on an existing Redis instance
Go to the Memorystore for Redis page in the Google Cloud console.
View your instance's Instance details page by clicking on your Instance ID.
Click the Edit button.
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 Save button.
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
Getting the AUTH string
Go to the Memorystore for Redis page in the Google Cloud console.
View your instance's Instance details page by clicking on your Instance ID.
Find the AUTH string value in the Security section.
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
Changing 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.
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
- View the AUTH feature overview.