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

add an ability to create serverless elasticache redis, add examples #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

inemyrovsk
Copy link
Contributor

No description provided.

Copy link
Contributor

@plain5 plain5 Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Examples must be created in the same way, as here.

  • Rename to memcached.

  • Create the following structure of the examples folder :

    • examples
      • complete
        • usual
          • redis
            • terragrunt.hcl (this file)
          • memcahed
            • terragrunt.hcl
        • serverless
          • redis
            • terragrunt.hcl
          • memcahed
            • terragrunt.hcl

Copy link
Contributor

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
Copy link
Contributor

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.

Comment on lines +113 to +115
for_each = var.cluster_mode_enabled ? concat([
{ name = "cluster-enabled", value = "yes" }
], var.parameter) : var.parameter
Copy link
Contributor

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.

Comment on lines +150 to +152
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)
]
Copy link
Contributor

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" {
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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# ----).

Comment on lines +406 to +430


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)
}

Copy link
Contributor

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" {
Copy link
Contributor

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" {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants