-
Notifications
You must be signed in to change notification settings - Fork 4k
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
kms.Key: kms.Key.isLookupDummy incorrectly throws error when no-pre-existing-key / dummy-key is found #32368
Comments
https://github.com/aws/aws-cdk/blob/v2.170.0/packages/aws-cdk-lib/aws-ssm/lib/parameter.ts#L587 so I think there's agreement in regards to my proposed solution to make the isLookupDummy() not throw an error, but the logic involved in that variable doesn't seem to prevent an error from being thrown. |
Hi @neoakris , I tested the feature and here is my observation-
so as proposed in this #31676, dummy value is returned in my case. As mentioned, the returned dummy key - is this what you are talking about ? |
Hi khushail, thank you for taking some time to look into and test this. Summary: Additional Details: I tried to create a short (relatively) self-contained example of the bug based on "aws-cdk": "2.170.0" This lead me to believe it's some kind of integration issue with eks-blueprints, so I tried to integrate eks-blueprints into the example to reproduce the error. Hum... When I first encountered the issue, I had managed to combine cdk-eks-blueprints 1.16.2, with a newer version of cdk 2.170.0, but things mostly seemed to work, but maybe this issue arose from me mixing cdk-eks-blueprint with a newer version of AWS CDK? instead of the version their project pins to. I forget the specifics of how I managed that so I'll replace the package.json with the one from the eks-blueprints project I was working on when I 1st found the issue to see if I can reproduce. setting my package.json to be like the other, ended up with npm peer dependencies error. I'm now woundering how this managed to work on my other setup, after clearing node_modules and trying to install fresh I noticed breakage there too. so this might be that I did something to my package.json file and it's getting stuck trying to use the old and new code at the same time, since the latest eks-blueprints uses an older version of cdk that predates your fix, and I somehow managed to do some tinkering to get it to temporarily partially work on my machine possibly in a wya with broken peer dependencies without realizing it. That probably means when I originally found the error it may have been due to a faulty local dev environment, that somehow allowed me to mix old and new version. So my bug report is likely invalid. Sorry for the noise and the trouble I've caused. |
No problem @neoakris. Happy to help! |
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
@go-to-k I just not around to testing the feature you added in #31574, and discovered:
There was a problem in logic of original feature request (which has now been auto-closed.)
The intent of the new feature was to allow:
^--kms.Key.isLookupDummy() method was intended to do this, before the feature keyid would return a token which didn't allow an if statement check to occur, the new method returns true when key not found.
(The bug is that it needlessly throws an error, which stops execution / doesn't make sense for an existence check. This is a relatively new feature and I suspect it never worked.)
Regression Issue
Last Known Working CDK Version
Not Applicable
Expected Behavior
Note: the value of this.config.kmsKeyAlias = alias/eks/dev1-eks (it'll show in error message)
^--I expect this logic (described in laymans terms above) to work.
Current Behavior
When I use
cdk deploy dev1-eks
to run the above logic snippet
It throws an error that stops everything, error shouldn't be thrown for an existance check.
Reproduction Steps
I'm going to ask if I can make some code public, which will make reproduction easier. (With luck that could happen around Jan/Feb)
Possible Solution
Make the method not throw error when the isLookupDummy() is used
Additional Information/Context
Below is the workaround I'm currently using today:
I'd like to replace it with a upstream cdk fix to feature of checking for existing kms, because the workaround has 3 negligible, yet undesirable side effects:
CDK CLI Version
2.170.0
Framework Version
No response
Node.js Version
v20.18.1
OS
Mac 15.1.1
Language
TypeScript
Language Version
5.4.5
Other information
No response
The text was updated successfully, but these errors were encountered: