Breaking Changes
Since long-term support for Node.js 18 has ended, we updated our minimum compatible node version to 20.9.
fs-extra to @cdktf/hcl-tools #3854CDKTF_LOG_FILE_DIRECTORY a common flag available on all commands #3495AWS Provider changes (breaking)
The AWS pre-built provider for Go is currently too large to be installed due to a hard limit in Go. This release adds skipping the statement block in the rule block of the aws_wafv2_web_acl and aws_wafv2_rule_group resources. Our resource docs page previously already mentioned that these resources have skipped attributes but they weren't actually skipped. This almost doubled AWS provider bindings in size due to the recursive nature of the statement block.
If you are using any of these two resources, the statement now has to be passed as a plain object instead and its keys have to be snake-cased (e.g. and_statement or regex_match_statement).
statement block for rule block in aws_wafv2_web_acl and aws_wafv2_rule_group resources #3414Breaking changes
To resolve #3026 we improved the logic for generating names for Terraform Modules. This makes the default module names nicer, but also leads to breaking changes for Python, C#, and Java. When updating CDKTF, please generate the new bindings with cdktf get after updating the CLI and update your module imports.
We have removed deprecated backends artifactory, etcd, etcdv3, manta, and swift. CDK for Terraform v0.14 deprecated these backends initially. Terraform removed these backends in v1.3. For migration paths from these removed backends, refer to Upgrading to Terraform v1.3.
We have dropped support for Python 3.7, please update to Python 3.8 or higher.
.allWithMapKey iterator to lists #3299conditional #3264Breaking changes
Since the long-term support for Node.js 16 ended on 2023-09-11, we updated our minimum compatible Node.js version to 18.12.
moveTo on TerraformResourceWe have added support for resource refactoring and renaming with the addition of the instance function moveTo on TerraformResource. We forsee the potential for naming collision with providers using moveTo as an attribute. In instances where provider bindings fail to compile due to the collision, regenerate your provider bindings and replace the provider related usage of moveTo to moveToAttribute in your configuration if applicable.
codeMakerOutput needs to be set to a company identifierWe did not honor the codeMakerOutput setting in the cdktf.json previously, this is fixed now.
To have no changes in the generated code you can set codeMakerOutput: "imports".
If you like, you can now set it to your company name, e.g. codeMakerOutput: "com.hashicorp" so that the provider is generated under the com.hashicorp.aws namespace for example. Omitting the codeMakerOutput will lead to the default value .gen being used and results in an error.
Fixes a bug in 0.18.1 that broke crash reporting due to a partial dependency upgrade.
Breaking changes
When using a Provider in python one could previously import the resource and data source namespaces on the root level. This is no longer possible and the namespaces must be imported through specifying the paht in the import. The syntax was supported before as well, so you can change your code within 0.17.x and then upgrade to 0.18.x.
Before:
from constructs import Construct
from cdktf import App, TerraformStack
from imports.aws import provider, sns_topic, lambda_function, iam_role
class MyStack(TerraformStack):
def __init__(self, scope: Construct, ns: str):
super().__init__(scope, ns)
provider.AwsProvider(self, 'Aws', region='eu-central-1')
sns_topic.SnsTopic(self, 'Topic', display_name='my-first-sns-topic')
role = iam_role.IamRole(self, 'Role', name='lambda-role',
assume_role_policy='{}')
lambda_function.LambdaFunction(self, 'Lambda', function_name='my-first-lambda-function',
role=role.arn, handler='index.handler', runtime='python3.6')
app = App()
MyStack(app, "before-change")
app.synth()
After:
from constructs import Construct
from cdktf import App, TerraformStack
from imports.aws.provider import AwsProvider
from imports.aws.sns_topic import SnsTopic
from imports.aws.lambda_function import LambdaFunction
from imports.aws.iam_role import IamRole
class MyStack(TerraformStack):
def __init__(self, scope: Construct, ns: str):
super().__init__(scope, ns)
AwsProvider(self, 'Aws', region='eu-central-1')
SnsTopic(self, 'Topic', display_name='my-first-sns-topic')
role = IamRole(self, 'Role', name='lambda-role',
assume_role_policy='{}')
LambdaFunction(self, 'Lambda', function_name='my-first-lambda-function',
role=role.arn, handler='index.handler', runtime='python3.6')
app = App()
MyStack(app, "after-change")
app.synth()