Skip to content

(opensearch): domain doesn't handle tokens in capacity configuration #15014

@leantorres73

Description

@leantorres73

If I set SSM for some parameters like dataNodeInstanceType, if fails on deployment time

Reproduction Steps

Create a ES Domain, and set capacity using SSM, like this:

capacity: {
      dataNodeInstanceType: `${ssm.StringParameter.valueForStringParameter(stack, 'ESInstanceTypeSSM', `elasticsearch/instance-type`)}.elasticsearch`,
      masterNodeInstanceType: `${ssm.StringParameter.valueForStringParameter(stack, 'ESInstanceTypeSSM', `elasticsearch/instance-type`)}.elasticsearch`,
      masterNodes: '1', 
      dataNodes: 2
}, 

Also, it shouldn't check if '.elasticsearch' is part of the text if a token is set there, but this second one is minor bug, the other one is an impediment of using SSM with ES configurations

What did you expect to happen?

Token resolved correctly.

What actually happened?

It fails, internally it's doing a .toLowerCase() and it's breaking the token

"${token[token.718]}.elasticsearch" instead of "${Token[Token.718]}.elasticsearch"

Environment

  • **CDK CLI Version: 1.106.0
  • **Node.js Version: 12
  • **OS : Linux
  • **Language (Version): Javascript

This is 🐛 Bug Report

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-elasticsearchRelated to Amazon Elasticsearch Service@aws-cdk/aws-opensearchRelated to the @aws-cdk/aws-opensearchservice packagebugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions