Merge pull request #1263 from robgil-dds/169163334-redis-module
169163334 - Adds redis module
This commit is contained in:
commit
585d52f045
24
terraform/modules/redis/main.tf
Normal file
24
terraform/modules/redis/main.tf
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
resource "azurerm_resource_group" "redis" {
|
||||||
|
name = "${var.name}-${var.environment}-redis"
|
||||||
|
location = var.region
|
||||||
|
}
|
||||||
|
|
||||||
|
# NOTE: the Name used for Redis needs to be globally unique
|
||||||
|
resource "azurerm_redis_cache" "redis" {
|
||||||
|
name = "${var.name}-${var.environment}-redis"
|
||||||
|
location = azurerm_resource_group.redis.location
|
||||||
|
resource_group_name = azurerm_resource_group.redis.name
|
||||||
|
capacity = var.capacity
|
||||||
|
family = var.family
|
||||||
|
sku_name = var.sku_name
|
||||||
|
enable_non_ssl_port = var.enable_non_ssl_port
|
||||||
|
minimum_tls_version = var.minimum_tls_version
|
||||||
|
|
||||||
|
redis_configuration {
|
||||||
|
enable_authentication = var.enable_authentication
|
||||||
|
}
|
||||||
|
tags = {
|
||||||
|
environment = var.environment
|
||||||
|
owner = var.owner
|
||||||
|
}
|
||||||
|
}
|
0
terraform/modules/redis/outputs.tf
Normal file
0
terraform/modules/redis/outputs.tf
Normal file
60
terraform/modules/redis/variables.tf
Normal file
60
terraform/modules/redis/variables.tf
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
variable "region" {
|
||||||
|
type = string
|
||||||
|
description = "Region this module and resources will be created in"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "name" {
|
||||||
|
type = string
|
||||||
|
description = "Unique name for the services in this module"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "environment" {
|
||||||
|
type = string
|
||||||
|
description = "Environment these resources reside (prod, dev, staging, etc)"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "owner" {
|
||||||
|
type = string
|
||||||
|
description = "Owner of the environment and resources created in this module"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "capacity" {
|
||||||
|
type = string
|
||||||
|
default = 2
|
||||||
|
description = "The capacity of the redis cache"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "family" {
|
||||||
|
type = string
|
||||||
|
default = "C"
|
||||||
|
description = "The subscription family for redis"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "sku_name" {
|
||||||
|
type = string
|
||||||
|
default = "Standard"
|
||||||
|
description = "The sku to use"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "enable_non_ssl_port" {
|
||||||
|
type = bool
|
||||||
|
default = false
|
||||||
|
description = "Enable non TLS port (default: false)"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "minimum_tls_version" {
|
||||||
|
type = string
|
||||||
|
default = "1.2"
|
||||||
|
description = "Minimum TLS version to use"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "enable_authentication" {
|
||||||
|
type = bool
|
||||||
|
default = true
|
||||||
|
description = "Enable or disable authentication (default: true)"
|
||||||
|
}
|
7
terraform/providers/dev/redis.tf
Normal file
7
terraform/providers/dev/redis.tf
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
module "redis" {
|
||||||
|
source = "../../modules/redis"
|
||||||
|
owner = var.owner
|
||||||
|
environment = var.environment
|
||||||
|
region = var.region
|
||||||
|
name = var.name
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user