-
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
core: CfnParameter not properly rendered #27064
Comments
Hi @emfrab , Thanks for reaching out. Yes, this seems to be an issue in rendering the value to ENUM thereby causing the error. I am marking this as P2. |
@khushail @emfrab this isn't supposed to work for a couple reasons. First off, More importantly, the value of a If you need to set it through a CfnParameter, the following solution should work by working around the need to supply a valid enum for param = cdk.CfnParameter(self, "param", type="Number", description="param")
lg = logs.LogGroup(self, 'lg')
lg.node.default_child.add_property_override("RetentionInDays", param.value_as_number) Be sure to note the documentation for Log Groups, I supposed we could intake this as a feature request to have a property that accepts a Number, but at that point we would have to do that for every enum for every construct which I don't think is a good idea. Closing out, feel free to ping if there are any further clarifications I can make |
|
thanks for the detailed response, @peterwoodworth! |
Describe the bug
The expected value for a
CfnParameter
is not properly rendered when accessing it duringcfn synth
.According to the guide the way to use
CfnParameters
is pretty straightforward:Expected Behavior
The value to be referenced with the default (1) or the parameter sent via CLI, i.e
cdk synth --parameters LogRetentionPeriod=2
Current Behavior
Fails with the following error:
Reproduction Steps
mkdir error_reproduction
cd error_reproduction
cdk init -l python
error_reproduction/error_reproduction_stack.py
:cdk synth
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.95.0 (build cfa7e88)
Framework Version
No response
Node.js Version
v18.17.1
OS
Windows 11
Language
Python
Language Version
Python 3.9.0
Other information
No response
The text was updated successfully, but these errors were encountered: