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 #793

Open
wants to merge 1 commit 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
6 changes: 5 additions & 1 deletion infrastructure/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
locals {
app_full_name = "xui-${var.component}"
ase_name = "core-compute-${var.env}"
local_env = (var.env == "preview" || var.env == "spreview") ? (var.env == "preview" ) ? "aat" : "saat" : var.env
local_env = (var.env == "preview" || var.env == "spreview") ? (var.env == "preview") ? "aat" : "saat" : var.env
shared_vault_name = "${var.shared_product_name}-${local.local_env}"
}

Expand Down Expand Up @@ -34,6 +34,10 @@ module "redis6-cache" {
business_area = "cft"
private_endpoint_enabled = true
public_network_access_enabled = false
sku_name = var.sku_name
family = var.family
capacity = var.capacity

}

resource "azurerm_application_insights" "appinsights" {
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ output "microserviceName" {
}

output "appInsightsInstrumentationKey" {
value = azurerm_application_insights.appinsights.instrumentation_key
value = azurerm_application_insights.appinsights.instrumentation_key
sensitive = true
}
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"
6 changes: 3 additions & 3 deletions infrastructure/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.19.1"
version = "~> 3.75.0"
}
}

required_version = "~> 1.3.5"
required_version = "~> 1.5.7"
}

provider "azurerm" {
features {}
features {}
}

16 changes: 15 additions & 1 deletion infrastructure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ variable "location" {
variable "env" {}

variable "shared_product_name" {
default = "rpx"
default = "rpx"
}

variable "subscription" {}
Expand All @@ -22,3 +22,17 @@ variable "application_type" {
default = "web"
description = "Type of Application Insights (Web/Other)"
}
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"
}