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

feat: Add redis node type as variable #84

Merged
merged 4 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
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
}
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,8 @@ 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
}