aws-cdk: Can't get a CfnInstance with instance.getInstance()
đ 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 |
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 21 (9 by maintainers)
Commits related to this issue
- fix(java): remove Jackson confusion with certain patterns Upon deserializing (`ObjectMapper#treeToValue`), Jackson will first validate the `valueType` for whether ti can be deserialized with the "sta... — committed to aws/jsii by RomainMuller 5 years ago
- fix(java): remove Jackson confusion with certain patterns (#987) * fix(java): remove Jackson confusion with certain patterns Upon deserializing (`ObjectMapper#treeToValue`), Jackson will first valid... — committed to aws/jsii by RomainMuller 5 years ago
- fix(java): remove Jackson confusion with certain patterns (Reintroduce #987). Upon deserializing (`ObjectMapper#treeToValue`), Jackson will first validate the `valueType` for whether ti can be deser... — committed to aws/jsii by RomainMuller 5 years ago
- fix(java): remove Jackson confusion with certain patterns (#1070) (Reintroduce #987). Upon deserializing (`ObjectMapper#treeToValue`), Jackson will first validate the `valueType` for whether ti can ... — committed to aws/jsii by rix0rrr 5 years ago
The reason probably being that the Java code contains an overloaded setter that Jackson canât pick between: