Skip to content

entur/terraform-google-memorystore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform module(s) for creating Google Cloud Memorystore instances following Entur's conventions

Modules for provisioning Memorystore instances on Google Cloud Platform.

Redis module

A Redis module that uses the init module as minimum input, while allowing overrides and additional configuration.

Module

Examples

Getting started

Example using the latest release

module "redis" {
  source = "github.com/entur/terraform-google-memorystore//modules/redis?ref=v2.0.0"
  ...
}

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.

Version constraints

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.

Contributing

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)

Prerequisites

  • 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

Versioning and release workflows are automated using Release Please. See GitHub´s documentation.

Tests

We are using the blueprint-test module for testing. https://pkg.go.dev/github.com/GoogleCloudPlatform/cloud-foundation-toolkit/infra/blueprint-test

Local testing

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=integration.

Automatic testing

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.