Skip to content

michelia-io/terraform-docker-redis

 
 

Repository files navigation

Docker Redis Service

Terraform module which deploys Redis service on Docker. Powered by Bitnami Redis Docker Image.

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

Usage

module "example" {
  source = "..."

  infrastructure = {
    network_id = "..."
  }

  architecture = "replication"

  engine_version = "7.0"
}

Examples

Contributing

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

Requirements

Name Version
terraform >= 1.0
docker >= 3.0.2

Providers

Name Version
docker >= 3.0.2

Modules

Name Source Version
master github.com/walrus-catalog/terraform-docker-containerservice v0.2.1&depth=1
slave github.com/walrus-catalog/terraform-docker-containerservice v0.2.1&depth=1

Resources

Name Type
docker_network.network data source

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_version Specify the deployment engine version, select from https://hub.docker.com/r/bitnami/redis/tags. string "7.0" no
infrastructure Specify the infrastructure information for deploying.

Examples:
infrastructure:
network_id: string, optional
domain_suffix: string, optional
object({
network_id = optional(string, "local-walrus")
domain_suffix = optional(string, "cluster.local")
})
{
"domain_suffix": "cluster.local",
"network_id": "local-walrus"
}
no
password Specify the account password. The password must be 8-32 characters long and start with any letter, number, or symbols: ! # $ % ^ & * ( ) _ + - =.
If not specified, it will use the first 16 characters of the username md5 hash value.
string null no
replication_readonly_replicas Specify the number of read-only replicas under the replication deployment. number 1 no
resources Specify the computing resources.

Examples:
resources:
cpu: number, optional
memory: number, optional # in megabyte
object({
cpu = optional(number, 0.25)
memory = optional(number, 1024)
})
{
"cpu": 0.25,
"memory": 1024
}
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 Redis service.
refer The refer, a map, including hosts, ports and account, which is used for dependencies or collaborations.

License

Copyright (c) 2023 Seal, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at LICENSE file for details.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Packages

No packages published

Languages

  • Shell 72.6%
  • HCL 23.2%
  • Makefile 4.2%