Breaking Changes Abbreviated version below, for a guide see Upgrade Guide for 0.13.
0.13 includes performance improvements to generated providers. Instead of exporting a flat list of exports including all supported resources and data sources, we now export each construct and it's associated structures in their own namespace. Due to this, the way you import constructs from your CDKTF application will change. For more information regarding this release, and some of the reasonings behind the changes, please check out the version 0.13 release post.
// Before version 0.13
import { Container, Image, DockerProvider } from "@ckdtf/provider-docker";
// Version 0.13
import { Image } from "@cdktf/provider-docker/lib/image";
import { DockerProvider } from "@cdktf/provider-docker/lib/provider";
import { Container } from "@cdktf/provider-docker/lib/container";
from cdktf_cdktf_provider_kubernetes.kubernetes import Namespace, Service, Deployment, KubernetesProvider
Breaking Changes
A very minor change in the UX of the cdktf get command now generates the provider bindings for all languages (except TypeScript) in parallel. This speeds up the process in general, but on devices with limited memory it could lead to Out of Memory errors. If this happens you can limit the parallelism by providing the parallelism flag: cdktf get --parallelism=1.
pipenv in log #2117Breaking Changes
A very minor change in the interface names for provisioners occured to support them in JSII languages, renaming the following interfaces:
ISSHProvisionerConnection to SSHProvisionerConnectionIWinrmProvisionerConnection to WinrmProvisionerConnectionIFileProvisioner to FileProvisionerILocalExecProvisioner to LocalExecProvisionerIRemoteExecProvisioner to RemoteExecProvisionerAnother very minor change is that we now use the CloudBackend by default when running cdktf init. This requires Terraform >=1.1, therefore an error is thrown on cdktf init if you want to use Terraform Cloud and are on an older version. Already existing projects are not affected and you can use cdktf init --local and configure the RemoteBackend if you need to use an older version.
NODE_OPTIONS #2009Breaking Changes
cdktf get exits with 0 exit code when no provider / module specifications are found in the cdktf.jsonPreviously we would throw an error and exit with 1 if there were no provider or module specifications in the cdktf.json file. This can be inconvenient if cdktf get is part of a workflow.
Fn.merge is split into Fn.mergeLists and Fn.mergeMapsThe Terraform merge function can merge both lists and maps, but this can cause issues when using the result in a typed language. Therefore we split it into Fn.mergeLists and Fn.mergeMaps, this means you need to change your cdktf programs code.
The generated provider bindings are based on the Terraform schema which does not support recursion and hence uses a large, explicit structure instead. Previously this resulted in long names such as e.g. Wafv2WebAclRuleStatementAndStatementStatementOrStatementStatementLabelMatchStatement. In 0.12 we implemented a first rough detection for this underlying recursion which drastically reduced the amount of generated interfaces as they now are converted to recursive data structures themselves.
If you are currently using those types e.g. in a language like Java, you will need to change them to the new shorter names.
for_each to implement apply time iteration #1830Breaking Changes
Abbreviated version below, for a guide see Upgrade Guide for 0.11
TF_VAR_ prefixed environment variables can no longer be accessed at synth timeThese environment variables will now be filtered out in the synth phase since they are only intended to be used during diff (plan) and deploy (apply) phases to supply values for TerraformVariables. This inhibits accidentally inlining those values into the generated cdk.tf.json config.
DEBUG is replaced by setting CDKTF_LOG_LEVEL=debug, setting the CDKTF_LOG_LEVEL to debug will now also behave like DEBUG=1 and include logs from the provider generationCDKTF_DISABLE_LOGGING=false is replaced by setting CDKTF_LOG_FILE_DIRECTORY=/path/to/logs/directory. If left empty no logs will be written.--disable-logging was removed, instead use the environment variable CDKTF_LOG_LEVEL=offDISABLE_VERSION_CHECK, CDKTF_DISABLE_PLUGIN_CACHE_ENV need to be set to true or 1, before anything worked.A TerraformStack may no longer contain whitespace characters, since we rely on paths being whitespace free. If you have a stack with an id containing a whitespace, please replace it with a hyphen. If the stack was already deployed with the default LocalBackend you might need to rename your statefile to match the new stack id.
For computed maps, the reference is now through a getter.
To access { property = "value" }, instead of resource.mapAttribute("property") you can now use resource.mapAttribute.lookup("property").
Assignable properties of the form Object[] or { [key: string]: Object } no longer have setters; they instead have putX methods. The getter return type is also changed to be a derivative of either ComplexList or ComplexMap.
ComplexList for any complex list #1725.terraform directory #1694Breaking Changes
cdktf synth --json Option #1640If 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).
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.
// previously
const firstItemId = resource.listAttribute("0").id;
// new
const firstItemId = resource.listAttribute.get(0).id;
const firstItem = resource.listAttribute.get(0); // now possible
first_item_id = resource.list_attribute("0").id;
--ci flag to jest invocations when in CI #1498Breaking Changes
This is an effort to make sure attributes can be freely passed between resources for all different types.
There is a minor breaking change:
count on resources and data sources has gone from number | cdktf.IResolvable to number. If code was previously passing an IResolvable, it will now need to use Token.asNumber()As part of an effort to use more native types, there are now tokens for maps of primitive values.
As a result, there is a minor breaking change:
{ [key: string]: TYPE } | cdktf.IResolvable to { [key: string]:TYPE } when TYPE is string, number, or boolean.
Fn.(...)) will now need to be passed to Token.as<String/Number/Boolean>Map() before assigning to a resource attribute.As part of an effort to use more native types, there are now tokens for number[].
This is mostly an internal change, but there is now Token.asNumberList() which can be used to convert other values into number[].
As a result of some standardization, there is a minor breaking change:
boolean[] to Array<boolean | IResolvable> | IResolvable.
boolean or boolean[] is representable by a token.boolean[] between resources and fuctions.List<Object>.cdk.tf.json output #1454integration:update command #1490