Can't get a CfnInstance with instance.getInstance()
See original GitHub issue🐛 Bug Report
What is the problem?
Can’t get a CfnInstance
with instance.getInstance()
. I was hoping to get a CfnInstance
to see if I can pass it in to Targets
of CfnMaintenanceWindowTargetProps
.
Reproduction Steps
(let [app (new App)
stack (new Stack app "stack" stack-props)
vpc (new Vpc stack "vpc")
instance (new Instance stack "server" instance-props)
window (new CfnMaintenanceWindow stack "window" maintenance-window-props)
target (new CfnMaintenanceWindowTarget stack "target" maintenance-window-target-props)]
(.getInstance instance)
(.synth app))
Verbose Log
Execution error (IllegalArgumentException) at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder/getSetter (POJOPropertyBuilder.java:497). Conflicting setter definitions for property “networkInterfaces”: software.amazon.awscdk.services.ec2.CfnInstance#setNetworkInterfaces(1 params) vs software.amazon.awscdk.services.ec2.CfnInstance#setNetworkInterfaces(1 params) class software.amazon.jsii.JsiiException
or
Execution error (IllegalArgumentException) at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder/getSetter (POJOPropertyBuilder.java:497). Conflicting setter definitions for property “blockDeviceMappings”: software.amazon.awscdk.services.ec2.CfnInstance#setBlockDeviceMappings(1 params) vs software.amazon.awscdk.services.ec2.CfnInstance#setBlockDeviceMappings(1 params)
Environment
- CDK CLI Version: 1.8.0 (build 5244f97)
- Module Version: 1.8.0.DEVPREVIEW
- OS: MacOS Mojave
- Language: Java
Other information
JsiiObjectMapper.java: | 57 | software.amazon.jsii.JsiiObjectMapper/treeToValue |
---|---|---|
JsiiObject.java: | 111 | software.amazon.jsii.JsiiObject/jsiiGet |
Instance.java: | 66 | software.amazon.awscdk.services.ec2.Instance/getInstance |
RestFn.java: | 1523 | clojure.lang.RestFn/invoke |
AFn.java: | 22 | clojure.lang.AFn/run |
AFn.java: | 22 | clojure.lang.AFn/run |
Thread.java: | 748 | java.lang.Thread/run |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:21 (9 by maintainers)
The reason probably being that the Java code contains an overloaded setter that Jackson can’t pick between:
The fix for this will roll out in the next CDK release. I’ll resolve this issue for now, please re-open if you still encounter the problem once the new release (probably
1.19.0
) is out.