A Terraform module for creating a fully functional Google Memorystore (redis) instance.
This module is meant for use with Terraform 0.12. If you haven't upgraded and need a Terraform 0.11.x-compatible version of this module, the last released version intended for Terraform 0.11.x is 0.1.0.
Check the examples/ directory for more.
module "memorystore" {
source = "terraform-google-modules/memorystore/google"
version = "1.0.0"
name = "my-memorystore"
project = "my-gcp-project"
}
Name | Description | Type | Default | Required |
---|---|---|---|---|
alternative_location_id | The alternative zone where the instance will be provisioned. | string | "null" |
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 |
display_name | An arbitrary and optional user-provided name for the instance. | string | "null" |
no |
enable_apis | Enable required APIs for Cloud Memorystore. | bool | "true" |
no |
labels | The resource labels to represent user provided metadata. | map(string) | "null" |
no |
location_id | The zone where the instance will be provisioned. If not provided, the service will choose a zone for the instance. For STANDARD_HA tier, instances will be created across two zones for protection against zonal failures. If [alternativeLocationId] is also provided, it must be different from [locationId]. | string | "null" |
no |
memory_size_gb | Redis memory size in GiB. Defaulted to 1 GiB | number | "1" |
no |
name | The ID of the instance or a fully qualified identifier for the instance. | string | n/a | yes |
project | The ID of the project in which the resource belongs to. | string | n/a | yes |
redis_version | The version of Redis software. | string | "null" |
no |
region | The GCP region to use. | string | "null" |
no |
reserved_ip_range | The CIDR range of internal addresses that are reserved for this instance. | string | "null" |
no |
tier | The service tier of the instance. https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Tier | string | "STANDARD_HA" |
no |
Name | Description |
---|---|
current_location_id | The current zone where the Redis endpoint is placed. |
host | The IP address of the instance. |
id | The memorystore instance ID. |
region | The region the instance lives in. |
The project has the following folders and files:
- /: root folder
- /examples: examples for using this module
- /scripts: Scripts for specific tasks on module (see Infrastructure section on this file)
- /test: Folders with files for testing the module (see Testing section on this file)
- /helpers: Optional helper scripts for ease of use
- /main.tf: main file for this module, contains all the resources to create
- /variables.tf: all the variables for the module
- /output.tf: the outputs of the module
- /readme.md: this file
- Terraform is installed on the machine where Terraform is executed.
- An existing google cloud project
- The
redis.googleapis.com
API should be enabled - A service account key
- Docker
- Terraform >= 0.12.0
- terraform-provider-google >= v2.5.0
Tests are run inside of an existing google cloud project.
- Create tfvars file for test:
cp test/fixtures/minimal/terraform.tfvars.example test/fixtures/minimal/terraform.tfvars
-
Edit new
test/fixtures/minimal/terraform.tfvars
and add project id to run test in. -
Copy a service account key (
credentials.json
file) into root of this repo. -
Run
make test_integration_docker
.
Run:
make generate_docs