Skip to content

walrus-catalog/terraform-google-redis

Repository files navigation

Google Redis Server

Terrafom module to deploy a Redis Server on Google Cloud.

  • Support standalone(one read-write instance) and replication(one read-write instance and multiple read-only instances, for read write splitting).

Usage

module "redis" {
  source = "..."

  infrastructure = {
    vpc_id        = "..."
  }
}

Examples

Contributing

Please read our contributing guide if you're interested in contributing to Walrus template.

Requirements

Name Version
terraform >= 1.0
google >= 3.5.0
random >= 3.5.1

Providers

Name Version
google >= 3.5.0
random >= 3.5.1

Modules

No modules.

Resources

Name Type
google_compute_global_address.default resource
google_compute_network.default resource
google_redis_instance.primary resource
google_service_networking_connection.default resource
random_string.name_suffix resource

Inputs

Name Description Type Default Required
architecture Specify the deployment architecture, select from standalone or replication. string "standalone" no
context Receive contextual information. When Walrus deploys, Walrus will inject specific contextual information into this field.

Examples:
context:
project:
name: string
id: string
environment:
name: string
id: string
resource:
name: string
id: string
map(any) {} no
engine_parameters Specify the deployment parameters, see https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Instance.FIELDS.redis_configs
list(object({
name = string
value = string
}))
[] no
engine_version Specify the deployment engine version, select from 7.0, 6.0, 5.0, 4.0, 3.2. string "7.0" no
infrastructure Specify the infrastructure information for deploying.

Examples:
infrastructure:
vpc_id: string, optional # the ID of the VPC where the Redis service applies. It is a fully-qualified resource name, such as projects/{project_id}/global/networks/{network_id}.
object({
vpc_id = optional(string)
})
{} no
replication_readonly_replicas Specify the number of read-only replicas under the replication deployment. number 1 no
resources Specify the computing resources.
Select from BASIC, STANDARD_HA.Choosing the computing resource is also related to the storage resource, please view the specification document for more information.

Examples:
resources:
class: string, optional # https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Tier
object({
class = optional(string, "STANDARD_HA")
})
{
"class": "STANDARD_HA"
}
no
storage Specify the Redis memory storage size in gigabytes.
Examples:
storage:
size: number, optional # in gigabytes
object({
size = optional(number, 5)
})
{
"size": 5
}
no

Outputs

Name Description
address The address, a string only has host, might be a comma separated string or a single string.
address_readonly The readonly address, a string only has host, might be a comma separated string or a single string.
connection The connection, a string combined host and port, might be a comma separated string or a single string.
connection_readonly The readonly connection, a string combined host and port, might be a comma separated string or a single string.
context The input context, a map, which is used for orchestration.
password The password of the account to access the database.
port The port of the service.
refer The refer, a map, including hosts, ports and account, which is used for dependencies or collaborations.