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

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

Open
inikolaev opened this issue Nov 28, 2017 · 0 comments
Open

Comments

@inikolaev
Copy link
Contributor

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.

inikolaev added a commit to inikolaev/senza that referenced this issue Nov 28, 2017
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

No branches or pull requests

1 participant