Describe the bug
The following works in TypeScript but doesn't work in C#:
var a = new CfnPrefixList(this, "SomeList", new CfnPrefixListProps()
{
PrefixListName = "SomeList",
MaxEntries = 3,
AddressFamily = "IPv4",
Entries = new[] {
new EntryProperty { Cidr = "1.2.3.4/24", Description = "" },
new EntryProperty { Cidr = "1.2.3.4/24", Description = "" },
new EntryProperty { Cidr = "1.2.3.4/24", Description = "" }
}
});
var b = a.Entries as CfnPrefixList.EntryProperty[]; // Returns null
var c = b.First().Cidr; // Throws ArgumentNullException
Workaround
Recommended workaround: store the values in an array before passing them to the construct.