Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hmcts/cnp-module-redis
Module that provision a redis paas inside a subnet
https://github.com/hmcts/cnp-module-redis
jenkins-cft jenkins-cft-a-c team-platform
Last synced: about 1 month ago
JSON representation
Module that provision a redis paas inside a subnet
- Host: GitHub
- URL: https://github.com/hmcts/cnp-module-redis
- Owner: hmcts
- License: mit
- Created: 2017-08-16T10:46:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-16T15:59:16.000Z (2 months ago)
- Last Synced: 2024-10-18T16:16:28.821Z (2 months ago)
- Topics: jenkins-cft, jenkins-cft-a-c, team-platform
- Language: HCL
- Size: 69.3 KB
- Stars: 1
- Watchers: 174
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# 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
```terraform
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
```tfvars
sku_name = "Premium"
family = "P"
capacity = "1"
```redis.tf
```terraform
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.capacityprivate_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](https://azure.microsoft.com/en-gb/pricing/details/cache/) for available options and cost impact.
### Configuration
## Providers
| Name | Version |
|------|---------|
| [azurerm](#provider\_azurerm) | n/a |## Resources
| Name | Type |
|------|------|
| [azurerm_private_endpoint.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |
| [azurerm_redis_cache.redis](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/redis_cache) | resource |
| [azurerm_resource_group.cache-resourcegroup](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource |
| [azurerm_subnet.private_endpoint_subnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [availability\_zones](#input\_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](#input\_business\_area) | business\_area name - sds or cft | `string` | `"cft"` | no |
| [capacity](#input\_capacity) | The size of the Redis cache to deploy. Valid values are 1, 2, 3, 4, 5 | `string` | `"1"` | no |
| [common\_tags](#input\_common\_tags) | Map of tags to tag all resources with | `map(string)` | n/a | yes |
| [env](#input\_env) | Environment to deploy to | `string` | n/a | yes |
| [family](#input\_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](#input\_location) | Azure datacenter location | `string` | n/a | yes |
| [maxfragmentationmemory\_reserved](#input\_maxfragmentationmemory\_reserved) | Value in megabytes reserved to accommodate for memory fragmentation | `string` | `"642"` | no |
| [maxmemory\_delta](#input\_maxmemory\_delta) | The max-memory delta for this Redis instance. | `string` | `"642"` | no |
| [maxmemory\_policy](#input\_maxmemory\_policy) | How Redis will select what to remove when maxmemory is reached | `string` | `"volatile-lru"` | no |
| [maxmemory\_reserved](#input\_maxmemory\_reserved) | Value in megabytes reserved for non-cache usage e.g. failover | `string` | `"642"` | no |
| [minimum\_tls\_version](#input\_minimum\_tls\_version) | The minimum TLS version | `string` | `"1.2"` | no |
| [name](#input\_name) | Override the default name of `$product-$env`, useful when upgrading versions | `string` | `null` | no |
| [private\_endpoint\_enabled](#input\_private\_endpoint\_enabled) | Deploy using a private endpoint rather than vnet integration (recommended) | `bool` | `false` | no |
| [private\_endpoint\_subnet](#input\_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](#input\_product) | https://hmcts.github.io/glossary/#platform | `string` | n/a | yes |
| [public\_network\_access\_enabled](#input\_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](#input\_redis\_version) | Redis version to be deployed 4 or 6 (4 is deprecated) | `string` | `"4"` | no |
| [resource\_group\_name](#input\_resource\_group\_name) | Name of existing resource group to deploy resources into | `string` | `null` | no |
| [sku\_name](#input\_sku\_name) | The SKU of Redis to use. Possible values are `Basic`, `Standard` and `Premium`. | `string` | `"Premium"` | no |
| [subnetid](#input\_subnetid) | Subnet to deploy the Redis instance to | `string` | `""` | no |## Outputs
| Name | Description |
|------|-------------|
| [access\_key](#output\_access\_key) | Primary access key to connect to redis with |
| [host\_name](#output\_host\_name) | Host name of the Redis cache |
| [redis\_port](#output\_redis\_port) | SSL port to connect to redis with |