-
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
All Cfn Types broken for .NET in 0.35.0 and 0.36.0 #3093
All Cfn Types broken for .NET in 0.35.0 and 0.36.0 #3093
Comments
Rolling back to each version this appears to be broken in 0.35.0 as well, but works in 0.34.0 |
Thanks for reporting |
Repro: using Amazon.CDK;
using Amazon.CDK.AWS.SNS;
namespace HelloCdk
{
public class HelloStack : Stack
{
public HelloStack(Construct parent, string id, IStackProps props) : base(parent, id, props)
{
new CfnTopic_(this, "FOO", null);
}
}
} |
So I think I have gained some understanding of what is going wrong here. There's a combination of multiple factors stemming from how JSII will get values passed back-and-forth between the .NET process and the Node process. Apparently, when objects are passed from JS to .NET by value (and not by reference), the .NET runtime deserializes those as I am trying to come up with a minimal repro on the JSII side alone, but it is quite challenging. A full blown fix might also be quite difficult to author (but maybe I'm wrong - I'll see clearer into this once I manage to get that minimal JSII repro). |
The `CfnResource#_toCloudFormation` method creates a `PostResolveToken` with a post-processor that was not ready to handle the absence of `Properties` on the resolved value. It is however possible that `Properties` are missing when an object is created with the default configuration (e.g: by `new sqs.CfnQueue(this, 'Queue');`). This change makes the post-processor function correctly handle `undefined` in this case. Related #3093
When structures (as literal JSON blocks) get passed through a "map" argument, a `JObject` would be passed to the method despite the declared type on the .NET code is `IDictionary`, resulting in a crash. This code forcefully converts `JObject` to `IDictionary<string, objetc>` in such code paths. Fixes aws/aws-cdk#3093
The `CfnResource#_toCloudFormation` method creates a `PostResolveToken` with a post-processor that was not ready to handle the absence of `Properties` on the resolved value. It is however possible that `Properties` are missing when an object is created with the default configuration (e.g: by `new sqs.CfnQueue(this, 'Queue');`). This change makes the post-processor function correctly handle `undefined` in this case. Related #3093
The `CfnResource#_toCloudFormation` method creates a `PostResolveToken` with a post-processor that was not ready to handle the absence of `Properties` on the resolved value. It is however possible that `Properties` are missing when an object is created with the default configuration (e.g: by `new sqs.CfnQueue(this, 'Queue');`). This change makes the post-processor function correctly handle `undefined` in this case. Related #3093
When structures (as literal JSON blocks) get passed through a "map" argument, a `JObject` would be passed to the method despite the declared type on the .NET code is `IDictionary`, resulting in a crash. This code forcefully converts `JObject` to `IDictionary<string, objetc>` in such code paths. Fixes aws/aws-cdk#3093
Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.
I'm submitting a ...
What is the current behavior?
Any command to create a CfnXXX object results in an exception when running cdk synth.
What is the expected behavior (or behavior of feature suggested)?
var vpc = new CfnVPC(this, "vpc", new CfnVPCProps { CidrBlock = "10.180.0.0/16", EnableDnsHostnames = true, EnableDnsSupport = true });
What is the motivation / use case for changing the behavior or adding this feature?
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)
The text was updated successfully, but these errors were encountered: