-
Notifications
You must be signed in to change notification settings - Fork 0
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
add an ability to create serverless elasticache redis, add examples #1
base: main
Are you sure you want to change the base?
Conversation
examples/memcache/terragrunt.hcl
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
examples/serverless/terragrunt.hcl
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Same notes as above.
@@ -90,7 +90,7 @@ resource "aws_security_group_rule" "this_egress_source" { | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
|
|||
resource "aws_elasticache_subnet_group" "this" { | |||
count = var.create_subnet_group ? 1 : 0 | |||
count = var.cache_type == "traditional" && var.create_subnet_group ? 1 : 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There is no reason to set
cache_type
here.
for_each = var.cluster_mode_enabled ? concat([ | ||
{ name = "cluster-enabled", value = "yes" } | ||
], var.parameter) : var.parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It's not convenient. Return to the one line.
preferred_cache_cluster_azs = length(var.preferred_cache_cluster_azs) == 0 ? null : [ | ||
for n in range(0, var.num_cache_clusters) : element(var.preferred_cache_cluster_azs, n) | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It's not convenient. Return to the one line.
default = 10000 | ||
} | ||
|
||
variable "serverless_tags" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serverless_cache_tags
.
description = "Address of the endpoint for the reader node in the replication group." | ||
} | ||
# --------------------------------------------------------------------------------------------------------------------- | ||
# ElastiCache Endpoint Serverless |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ElastiCache Serverless.
@@ -395,6 +402,32 @@ variable "transit_encryption_enabled" { | |||
EOT | |||
} | |||
|
|||
# Serverless-specific variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ElastiCache Serverless
. Also, add proper formatting(# ----\n# TEXT\n# ----)
.
|
||
|
||
variable "name" { | ||
description = "Name for serverless cache." | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "data_storage_maximum" { | ||
description = "Maximum data storage for serverless cache." | ||
type = number | ||
default = 50 | ||
} | ||
|
||
variable "ecpu_per_second_maximum" { | ||
description = "Maximum ECPU units per second for serverless cache." | ||
type = number | ||
default = 10000 | ||
} | ||
|
||
variable "serverless_tags" { | ||
description = "Tags for serverless cache." | ||
type = map(any) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
It's easier and better to take variables description from Documentation.
-
Format should be :
type
default
description
@@ -200,3 +204,28 @@ resource "aws_elasticache_replication_group" "this" { | |||
aws_security_group.this | |||
] | |||
} | |||
|
|||
resource "aws_elasticache_serverless_cache" "serverless" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resource "aws_elasticache_serverless_cache" "this" {
No description provided.