Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate redis cache to Basic sku in non-prod env #319

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"enabledManagers": ["helm-requirements", "nvm"],
"automerge": true,
"labels": ["dependencies"],
"helm-requirements": {
"fileMatch": ["\\Chart.yaml$"],
"aliases": {
"hmctspublic": "https://hmctspublic.azurecr.io/helm/v1/repo/"
}
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>hmcts/.github//renovate/automerge-minor",
"local>hmcts/.github:renovate-config"
]
}
}

34 changes: 19 additions & 15 deletions infrastructure/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
provider "azurerm" {
features {}
features {}
}

locals {
Expand All @@ -9,20 +9,24 @@ locals {
data "azurerm_subnet" "core_infra_redis_subnet" {
name = "core-infra-subnet-1-${var.env}"
virtual_network_name = "core-infra-vnet-${var.env}"
resource_group_name = "core-infra-${var.env}"
resource_group_name = "core-infra-${var.env}"
}

module "fis-ds-web-session-storage" {
source = "git@github.com:hmcts/cnp-module-redis?ref=master"
product = "${var.product}-${var.component}-session-storage"
location = var.location
env = var.env
subnetid = data.azurerm_subnet.core_infra_redis_subnet.id
common_tags = var.common_tags
source = "git@github.com:hmcts/cnp-module-redis?ref=master"
product = "${var.product}-${var.component}-session-storage"
location = var.location
env = var.env
subnetid = data.azurerm_subnet.core_infra_redis_subnet.id
common_tags = var.common_tags
sku_name = var.sku_name
family = var.family
capacity = var.capacity

}

data "azurerm_key_vault" "fis_key_vault" {
name = "fis-kv-${var.env}"
name = "fis-kv-${var.env}"
resource_group_name = "${var.raw_product}-${var.env}"
}

Expand All @@ -43,18 +47,18 @@ resource "azurerm_key_vault_secret" "s2s-secret" {
}

data "azurerm_key_vault_secret" "idam-ui-secret" {
name = "idam-ui-secret"
key_vault_id = "${data.azurerm_key_vault.fis_key_vault.id}"
name = "idam-ui-secret"
key_vault_id = data.azurerm_key_vault.fis_key_vault.id
}

data "azurerm_key_vault_secret" "idam-system-user-name" {
name = "idam-system-user-name"
key_vault_id = "${data.azurerm_key_vault.fis_key_vault.id}"
name = "idam-system-user-name"
key_vault_id = data.azurerm_key_vault.fis_key_vault.id
}

data "azurerm_key_vault_secret" "idam-system-user-password" {
name = "idam-system-user-password"
key_vault_id = "${data.azurerm_key_vault.fis_key_vault.id}"
name = "idam-system-user-password"
key_vault_id = data.azurerm_key_vault.fis_key_vault.id
}

resource "azurerm_key_vault_secret" "redis_access_key" {
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/output.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output "env" {
value = "${var.env}"
value = var.env
}
3 changes: 3 additions & 0 deletions infrastructure/prod.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sku_name = "Premium"
family = "P"
capacity = "1"
22 changes: 18 additions & 4 deletions infrastructure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ variable "location" {
default = "UK South"
}

variable "env" { }
variable "env" {}

variable "ilbIp" { }
variable "ilbIp" {}


variable "subscription" {}

variable "jenkins_AAD_objectId" {
description = "(Required) The Azure AD object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. The object ID must be unique for the list of access policies."
description = "(Required) The Azure AD object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. The object ID must be unique for the list of access policies."
}

variable "tenant_id" {
Expand All @@ -35,9 +35,23 @@ variable "node_env" {

variable "appinsights_instrumentation_key" {
description = "Instrumentation key of the App Insights instance this webapp should use. Module will create own App Insights resource if this is not provided"
default = ""
default = ""
}

variable "common_tags" {
type = map(string)
}
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"
}