GCP Memorystore for Redis

Google Memorystore for Redis provides a fully-managed service that is powered by the Redis in-memory data store to build application caches that provide sub-millisecond data access. The official documentations: Google Memorystore for Redis and Memorystore configuration for Redis.

This module creates a Memorystore for Redis with these possibilities :

  • Configure the persistence for the Memorystore.

  • Configure the maintenance policy for the Memorystore.

  • The Transit encryption is set to true by default.

Requirements

Name

Version

terraform

>= 1.0

google

>= 4.75.0

kubernetes

>= 2.7.1

Providers

Name

Version

google

>= 4.75.0

kubernetes

>= 2.7.1

Modules

No modules.

Resources

Name

Type

google_kms_crypto_key_iam_member.kms

resource

google_redis_instance.cache

resource

kubernetes_secret.redis_ca

resource

kubernetes_secret.redis_user_credentials

resource

google_client_config.current

data source

google_project.project

data source

Inputs

Name

Description

Type

Default

Required

adapter_absolute_path

The adapter’s absolute path

string

"/adapters/object/redis/ArmoniK.Core.Adapters.Redis.dll"

no

adapter_class_name

Name of the adapter’s class

string

"ArmoniK.Core.Adapters.Redis.ObjectBuilder"

no

auth_enabled

Indicates whether OSS Redis AUTH is enabled for the instance. If set to true AUTH is enabled on the instance.

bool

false

no

authorized_network

The full name of the Google Compute Engine network to which the instance is connected. If left unspecified, the default network will be used.

string

null

no

client_name

Name of the redis client

string

"ArmoniK.Core"

no

connect_mode

The connection mode of the Redis instance. Can be either DIRECT_PEERING or PRIVATE_SERVICE_ACCESS. The default connect mode if not provided is DIRECT_PEERING.

string

"DIRECT_PEERING"

no

customer_managed_key

Default encryption key to apply to the Redis instance. Defaults to null (Google-managed).

string

null

no

display_name

An arbitrary and optional user-provided name for the instance.

string

null

no

instance_name

Name of the instance

string

"ArmoniKRedis"

no

labels

The resource labels to represent user provided metadata.

map(string)

null

no

locations

The zones where the instance will be provisioned. If two zones are given, HA is enabled.

set(string)

[]

no

maintenance_policy

The maintenance policy for an instance. For more information see maintenance_policy.

object({
day = string
start_time = object({
hours = number
minutes = number
seconds = number
nanos = number
})
})

null

no

memory_size_gb

Redis memory size in GiB.

number

n/a

yes

name

The ID of the instance or a fully qualified identifier for the instance.

string

n/a

yes

namespace

Namespace of ArmoniK storage resources

string

"armonik"

no

object_storage_adapter

Name of the adapter’s

string

"ArmoniK.Adapters.Redis.ObjectStorage"

no

path

Path for mounting secrets

string

"/redis"

no

persistence_config

The Redis persistence configuration parameters. For more information see persistence_config.

object({
persistence_mode = string
rdb_snapshot_period = string
rdb_snapshot_start_time = string
})

null

no

private_service_access_peering

Name of the peering. Ensures the Redis cluster is created after the peering is in place.

string

null

no

read_replicas_mode

Read replicas mode.

string

"READ_REPLICAS_DISABLED"

no

redis_configs

The Redis configuration parameters. See documentation in Supported Redis configuration.

map(any)

{}

no

redis_version

The version of Redis software.

string

null

no

replica_count

The number of replicas.

number

null

no

reserved_ip_range

The CIDR range of internal addresses that are reserved for this instance.

string

null

no

secondary_ip_range

Optional. Additional IP range for node placement. Required when enabling read replicas on an existing instance. See secondary_ip_range.

string

null

no

ssl_option

Ssl option

string

"true"

no

tier

The service tier of the instance.

string

"BASIC"

no

transit_encryption_mode

The TLS mode of the Redis instance, If not provided, TLS is enabled for the instance.

string

"SERVER_AUTHENTICATION"

no

Outputs

Name

Description

auth_string

AUTH String set on the instance. This field will only be populated if auth_enabled is true.

current_location_id

The current zone where the Redis endpoint is placed.

env

Elements to be set as environment variables

env_secret

Secrets to be set as environment variables

host

The IP address of the instance.

id

The Memorystore instance ID.

mount_secret

Secrets to be mounted as volumes

nodes

Info per node. The parameters are: “id” and “zone”.

persistence_iam_identity

Cloud IAM identity used by import/export operations. Format is ‘serviceAccount:’. May change over time

port

The port number of the exposed Redis endpoint.

read_endpoint

The IP address of the exposed readonly Redis endpoint.

read_endpoint_port

The port number of the exposed readonly Redis endpoint. Standard tier only. Write requests should target ‘port’.

read_endpoint_url

The URL of the exposed readonly Redis endpoint.

region

The region the instance lives in.

server_ca_certs

List of server CA certificates for the instance

url

The URL of the exposed Redis endpoint.

Examples