Giter Club home page Giter Club logo

cnp-module-redis's Introduction

cnp-module-redis

This repository contains the module that enables you to create a Redis PaaS instance.

Usage

Recommended example for cost optimisation

Premium redis PaaS instance are very expensive, care must be taken when using them and only used in required environments. This should only be production unless you really need it in a different environment.

variables.tf

variable "family" {
  default     = "C"
  description = "The SKU family/pricing group to use. Valid values are `C` (for Basic/Standard SKU family) and `P` (for Premium). Use P for higher availability, but beware it costs a lot more."
}

variable "sku_name" {
  default     = "Basic"
  description = "The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`."
}

variable "capacity" {
  default     = "1"
  description = "The size of the Redis cache to deploy. Valid values are 1, 2, 3, 4, 5"
}

The following values are recommended for use in the production environment:

prod.tfvars

sku_name = "Premium"
family   = "P"
capacity = "1"

redis.tf

module "redis" {
  source                   = "[email protected]:hmcts/cnp-module-redis?ref=master"
  product                  = var.product
  location                 = var.location
  env                      = var.env
  common_tags              = var.common_tags
  redis_version            = "6"
  business_area            = "cft" # cft or sds
  sku_name                 = var.sku_name
  family                   = var.family
  capacity                 = var.capacity

  private_endpoint_enabled      = true
  public_network_access_enabled = false
}

resource "azurerm_key_vault_secret" "redis_access_key" {
  name         = "redis-access-key"
  value        = module.redis-activity-service.access_key
  key_vault_id = data.azurerm_key_vault.vault.id
}

If you need to increase cache size take a look at the pricing page for available options and cost impact.

Configuration

Providers

Name Version
azurerm n/a

Resources

Name Type
azurerm_private_endpoint.this resource
azurerm_redis_cache.redis resource
azurerm_resource_group.cache-resourcegroup resource
azurerm_subnet.private_endpoint_subnet data source

Inputs

Name Description Type Default Required
availability_zones Specifies a list of Availability Zones in which this Redis Cache should be located. Changing this forces a new Redis Cache to be created. list(any) null no
business_area business_area name - sds or cft string "cft" no
capacity The size of the Redis cache to deploy. Valid values are 1, 2, 3, 4, 5 string "1" no
common_tags Map of tags to tag all resources with map(string) n/a yes
env Environment to deploy to string n/a yes
family The SKU family/pricing group to use. Valid values are C (for Basic/Standard SKU family) and P (for Premium). Use P for higher availability, but beware it costs a lot more. string "P" no
location Azure datacenter location string n/a yes
maxfragmentationmemory_reserved Value in megabytes reserved to accommodate for memory fragmentation string "642" no
maxmemory_delta The max-memory delta for this Redis instance. string "642" no
maxmemory_policy How Redis will select what to remove when maxmemory is reached string "volatile-lru" no
maxmemory_reserved Value in megabytes reserved for non-cache usage e.g. failover string "642" no
minimum_tls_version The minimum TLS version string "1.2" no
name Override the default name of $product-$env, useful when upgrading versions string null no
private_endpoint_enabled Deploy using a private endpoint rather than vnet integration (recommended) bool false no
private_endpoint_subnet Specify your own subnet for private link integration, if you don't specify one then it will be calculated for you. string "" no
product https://hmcts.github.io/glossary/#platform string n/a yes
public_network_access_enabled Whether or not public network access is allowed for this Redis Cache. true means this resource could be accessed by both public and private endpoint. false means only private endpoint access is allowed. Defaults to true. bool true no
redis_version Redis version to be deployed 4 or 6 (4 is deprecated) string "4" no
resource_group_name Name of existing resource group to deploy resources into string null no
sku_name The SKU of Redis to use. Possible values are Basic, Standard and Premium. string "Premium" no
subnetid Subnet to deploy the Redis instance to string "" no

Outputs

Name Description
access_key Primary access key to connect to redis with
host_name Host name of the Redis cache
redis_port SSL port to connect to redis with

cnp-module-redis's People

Contributors

calinmarina avatar chris-pateman avatar chrisann avatar cpareek avatar dansanabria avatar dwaynebailey avatar endakelly avatar hibri avatar jordanhoey96 avatar liamfoneill avatar martyfox avatar mokainos avatar motahir avatar naikajah avatar nikola-naydenov-hmcts avatar njrich28 avatar renovate[bot] avatar thomast1906 avatar timja avatar timwebster9 avatar verityit avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

uk-gov-mirror

cnp-module-redis's Issues

Incorrect memory settings for Basic and Standard SKUs

What would you like to change?

maxfragmentationmemory_reserved and maxmemory_reserved variables are defaulted to "642" regardless of the SKU that is used.

When using Basic or Standard SKU, these values are better set to "125". When set to "642" we have noticed it can cause issues with the load hitting 100% and never recovering.

How do you think that would improve the project?

Setting the correct defaults for the SKU chosen to prevent issues with the cache.

If this entry is related to a bug, please provide the steps to reproduce it

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/terraform-docs.yaml
  • actions/checkout v4
.github/workflows/terraform.yaml
  • actions/checkout v4
  • actions/checkout v4
terraform
example/main.tf
example/provider.tf
terraform-version
.terraform-version
  • hashicorp/terraform 1.9.5

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.