Modules for provisioning Memorystore instances on Google Cloud Platform.
A Redis module that uses the init module as minimum input, while allowing overrides and additional configuration.
module "redis" {
source = "github.com/entur/terraform-google-memorystore//modules/redis?ref=v0.2.3"
...
}
See the README.md
under each module's subfolder for a list of supported inputs and outputs. For examples showing how they're implemented, check the examples subfolder.
You can control the version of a module dependency by adding ?ref=TAG
at the end of the source argument, as shown in the example above. This is highly recommended. You can find a list of available versions here.
Dependency automation tools such as Renovate Bot will be able to discover new releases and suggest updates automatically.
We welcome contributions to this repo. How to contribute:
- Clone this repo, create a branch locally, make changes
- Run
terraform fmt
to format the Terraform code - Run the tests locally (see Prerequisites and Local testing)
- Push your branch to the remote repo, create a pull request (PR)
- The tests are run by GitHub Actions (see Automatic testing)
- Team Plattform at Entur reviews the PR, approves and merges the changes
- Team Plattform creates a new release (see [Versioning]](#versioning)
- You need to have Terraform installed (version: see versions.tf)
- You need to have Go installed (version >=1.19 because of the
go:build
directive format used in the go files) - You need to have gcloud installed and be authenticated (
gcloud auth application-default login
) - Your user must have the necessary permissions on the GCP project used to run the tests
Versioning and release workflows are automated using Release Please. See GitHub´s documentation.
The test setup is inspired by this Medium post.
To run the tests locally, make sure the prerequisites are in place. Make sure that you are running the go commands to test in the tests
folder.
The test files have build tags, these can be used to run only a subset of the tests, for example like this: go test -v -tags=unit
.
Separate GitHub workflows is defined for testing the module:
These run every time a change is pushed to GitHub, but filters in the workflows stops the tests from running when no changes is made in the modules or the workflows.