Describe the bug
Hi,
I'm using aws-cdk for java. After upgrading the artifact software.amazon.jsii:jsii-runtime from version 1.85.0 to 1.86.0 a lot of my stacks don't compile anymore. Here an example stack
public class RolesAnywhereStack extends Stack {
public RolesAnywhereStack(App parent) {
super(parent, "RolesAnywhereStack");
final Role bastionRole = Role.Builder.create(this, "RolesAnywhereBastionRole")
.assumedBy(new ServicePrincipal("rolesanywhere.amazonaws.com"))
.description("Role that is used when connecting via RolesAnywhere")
.build();
CfnRole cfnRole = (CfnRole) bastionRole.getNode().getDefaultChild();
}
}
when running cdk synthesize RolesAnywhereStack a ClassCastException occurs:
Caused by: java.lang.ClassCastException: class software.constructs.Construct cannot be cast to class software.amazon.awscdk.services.iam.CfnRole (software.constructs.Construct and software.amazon.awscdk.services.iam.CfnRole are in unnamed module of loader java.net.URLClassLoader @7486e0ca)
with jsii-runtime 1.85.0 everything works fine.
Expected Behavior
No ClassCastException
Current Behavior
ClassCastException
Reproduction Steps
try to synthesize this stack
public class RolesAnywhereStack extends Stack {
public RolesAnywhereStack(App parent) {
super(parent, "RolesAnywhereStack");
final Role bastionRole = Role.Builder.create(this, "RolesAnywhereBastionRole")
.assumedBy(new ServicePrincipal("rolesanywhere.amazonaws.com"))
.description("Role that is used when connecting via RolesAnywhere")
.build();
CfnRole cfnRole = (CfnRole) bastionRole.getNode().getDefaultChild();
}
}
Possible Solution
No response
Additional Information/Context
No response
SDK version used
software.amazon.jsii:jsii-runtime:1.85.0
Environment details (OS name and version, etc.)
Debian openjdk version "17.0.2" 2022-01-18 OpenJDK Runtime Environment (build 17.0.2+8-86) OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)
Describe the bug
Hi,
I'm using aws-cdk for java. After upgrading the artifact software.amazon.jsii:jsii-runtime from version 1.85.0 to 1.86.0 a lot of my stacks don't compile anymore. Here an example stack
when running
cdk synthesize RolesAnywhereStacka ClassCastException occurs:with jsii-runtime 1.85.0 everything works fine.
Expected Behavior
No ClassCastException
Current Behavior
ClassCastException
Reproduction Steps
try to synthesize this stack
Possible Solution
No response
Additional Information/Context
No response
SDK version used
software.amazon.jsii:jsii-runtime:1.85.0
Environment details (OS name and version, etc.)
Debian openjdk version "17.0.2" 2022-01-18 OpenJDK Runtime Environment (build 17.0.2+8-86) OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)