Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Allow to specify Redis cluster name when using RedisNode component #493

@inikolaev

Description

@inikolaev

Right now when using RedisNode component to create Redis instance cluster name is set to the name of the resource section where component is declared:

SenzaComponents:
  - Configuration:
      Type: Senza::StupsAutoConfiguration
  - Redis:
      Type: Senza::RedisNode
      CacheNodeType: "{{Arguments.InstanceType}}"
      CacheParameterGroupName: "{{Arguments.RedisParameterGroupName}}"
      EngineVersion: "{{Arguments.RedisVersion}}"
      SecurityGroups:
        - Fn::GetAtt: ["RedisSecurityGroup", GroupId]

The above definition will create a cluster named redis.

While it's possible to use mustache templates to name a section I don't particulary like that approach as it hurts readability in my opinion.

I would like to propose to support ClusterName attribute which would allow to set cluster name, For compatibility it will fallback to using section name. After that change the template will look like this:

SenzaComponents:
  - Configuration:
      Type: Senza::StupsAutoConfiguration
  - Redis:
      Type: Senza::RedisNode
      CacheNodeType: "{{Arguments.InstanceType}}"
      CacheParameterGroupName: "{{Arguments.RedisParameterGroupName}}"
      ClusterName: "{{Arguments.Environment}}-redis-{{Arguments.ClusterName}}"
      EngineVersion: "{{Arguments.RedisVersion}}"
      SecurityGroups:
        - Fn::GetAtt: ["RedisSecurityGroup", GroupId]

I will provide a PR for this ticket shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions