aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.54k stars 3.86k forks source link

(elasticsearch): No longer support for parameter store value in masterNodes #18345

Closed leantorres73 closed 2 years ago

leantorres73 commented 2 years ago

What is the problem?

const esDomain = new es.Domain(stack, 'ESDomain', {
        domainName: 'vv-vpc',
        ...
        capacity: {
            dataNodeInstanceType: `${instanceType}.elasticsearch`,
            masterNodeInstanceType: `${instanceType}.elasticsearch`,
            masterNodes: ssm.StringParameter.valueForStringParameter(
                stack,
                'ESMasterNodeSSM',
                `${repositoryName}/elasticsearch/master-nodes`
            ),
            dataNodes: 2
        },
        ...
    });

I had this piece of code working until I updated from 1.129.0 to 1.138.2. Now I'm getting the following error:

Incorrect format is used in the following SSM reference: [{{resolve:ssm:ESMasterNodeSSM:vector-infrastructure/elasticsearch/master-nodes}}]

Reproduction Steps

Create an es Domain and set an SSM value for masterNodes.

What did you expect to happen?

It should resolve the value from SSM

What actually happened?

Incorrect format is used in the following SSM reference: [{{resolve:ssm:ESMasterNodeSSM:vector-infrastructure/elasticsearch/master-nodes}}] (

CDK CLI Version

1.138.2

Framework Version

No response

Node.js Version

12

OS

Mac OS

Language

Typescript

Language Version

No response

Other information

No response

kaizencc commented 2 years ago

Sorry, I'm having trouble seeing how your code would work at all. The signature for StringParameter.valueForStringParameter is

valueForStringParameter(scope: Construct, parameterName: string, version?: number | undefined): string

This hasn't changed in 3 years. Feels like the code snippet you've given is not syntactically correct for your StringParameter, although I don't see how that would succeed in 1.129 either. Can you double check this for me? Maybe I'm missing something.

leantorres73 commented 2 years ago

Sorry, I'm having trouble seeing how your code would work at all. The signature for StringParameter.valueForStringParameter is

valueForStringParameter(scope: Construct, parameterName: string, version?: number | undefined): string

This hasn't changed in 3 years. Feels like the code snippet you've given is not syntactically correct for your StringParameter, although I don't see how that would succeed in 1.129 either. Can you double check this for me? Maybe I'm missing something.

You're right, believe it or not, that code has been working for several months before the last update into 1.138.2 (who knows why). I'll fix it and see if it fails or not. Thanks and sorry!

github-actions[bot] commented 2 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.