Skip to content

Commit

Permalink
feat: Add redis node type as variable (#84)
Browse files Browse the repository at this point in the history
* fix: update README

* Adds redis node type as env var

* add default
  • Loading branch information
venky-wandb authored May 18, 2023
1 parent 8a074ab commit fee5a85
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ resources that lack official modules.

### A note on updating EKS cluster version

Users can update the EKS cluster version to the latest version offered by AWS. This can be done using the environment variable `eks_cluster_version`. Note that, cluster and nodegroup version updates can only be done in increments of one version at a time. For example, if your current cluster version is `1.21` and the latest version available is `1.24` - you'd need to first update `1.21` to `1.22`, run `terraform apply`, then upgrade to `1.23`, run `tf apply` and finally to `1.24`, run `tf apply`. You will not be able to upgrade directly from `1.21` to `1.24`.
Users can update the EKS cluster version to the latest version offered by AWS. This can be done using the environment variable `eks_cluster_version`. Note that, cluster and nodegroup version updates can only be done in increments of one version at a time. For example, if your current cluster version is `1.21` and the latest version available is `1.24` - you'd need to:

- Update `1.21` to `1.22`, run `terraform apply`,
- then upgrade to `1.23`, run `tf apply` and
- finally to `1.24`, run `tf apply`.

You will not be able to upgrade directly from `1.21` to `1.24`.

<!-- BEGIN_TF_DOCS -->
## Requirements
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ module "redis" {
vpc_id = local.network_id
redis_subnet_group_name = local.network_elasticache_subnet_group_name
vpc_subnets_cidr_blocks = module.networking.elasticache_subnet_cidrs
elasticache_node_type = var.elasticache_node_type

kms_key_arn = local.kms_key_arn
}
2 changes: 1 addition & 1 deletion modules/redis/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resource "aws_elasticache_replication_group" "default" {
number_cache_clusters = 2
port = 6379

node_type = "cache.t2.medium"
node_type = var.node_type
parameter_group_name = "default.redis6.x"
engine_version = local.redis_version

Expand Down
7 changes: 6 additions & 1 deletion modules/redis/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ variable "vpc_subnets_cidr_blocks" {
variable "kms_key_arn" {
description = "The ARN for the KMS encryption key."
type = string
}
}

variable "node_type" {
description = "The type of the redis node to deploy"
type = string
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,9 @@ variable "create_elasticache" {
description = "Boolean indicating whether to provision an elasticache instance (true) or not (false)."
default = false
}

variable "elasticache_node_type" {
description = "The type of the redis cache node to deploy"
type = string
default = "cache.t2.medium"
}

0 comments on commit fee5a85

Please sign in to comment.