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.71k stars 3.94k forks source link

(EKS): outputConfigCommand does not work any more without mastersRole #32318

Open markusl opened 1 day ago

markusl commented 1 day ago

Describe the bug

outputConfigCommand does not output anything if props.mastersRole is not set.

Regression Issue

Last Known Working CDK Version

No response

Expected Behavior

Output config command

Current Behavior

    const outputConfigCommand = (props.outputConfigCommand ?? true) && props.mastersRole;
    if (outputConfigCommand) {
      const postfix = commonCommandOptions.join(' ');
      new CfnOutput(this, 'ConfigCommand', { value: `${updateConfigCommandPrefix} ${postfix}` });
      new CfnOutput(this, 'GetTokenCommand', { value: `${getTokenCommandPrefix} ${postfix}` });
    }

Reproduction Steps

Set outputConfigCommand to true

Possible Solution

No response

Additional Information/Context

Seems to be broken in https://github.com/aws/aws-cdk/commit/51f0193bf34cca8254743561a1176e3ca5d83a74

CDK CLI Version

2.171.0 (build 4957967)

Framework Version

No response

Node.js Version

20

OS

Mac

Language

TypeScript

Language Version

No response

Other information

No response

pahud commented 14 hours ago

https://github.com/aws/aws-cdk/blob/0e79874623ecf34df998dd3c85f8de3fbe51b7ee/packages/aws-cdk-lib/aws-eks/lib/cluster.ts#L1822

This was an intentional breaking change from https://github.com/aws/aws-cdk/pull/25473

markusl commented 12 hours ago

@pahud yes, it seems to be an intentional change, but I cannot see why. Please at least document the behavior and add a warning if the flag is set to true without mastersRole