Breaking Changes
Remove cdktf synth --json
Option #1640
If you are using cdktf synth --json <stack-name>
to get the synthesized JSON configuration for your Stack, you will now need to run cdktf synth && cat ./cdktf.out/stacks/<stack-name>/cdk.tf.json
instead. The ./cdktf.out
part is your output directory (set by cdktf.json
or via the --output
flag).
Model ComplexComputedLists as ComplexLists and ComputedObjects #1499
In an effort to streamline the interfaces of resources, computed attributes of the type list and set are now modeled as a separate ComplexList
type instead of being a method that directly takes an index and returns an item. This change also did change the type of the index from string
to number
.
Typescript
// previously
const firstItemId = resource.listAttribute("0").id;
// new
const firstItemId = resource.listAttribute.get(0).id;
const firstItem = resource.listAttribute.get(0); // now possible
Python
first_item_id = resource.list_attribute("0").id;