github hashicorp/terraform-cdk v0.18.0

latest releases: v0.21.0-pre.137, v0.20.10, v0.21.0-pre.136...
15 months ago

chore

  • chore: Disable windows integration tests temporarily #3086
  • chore: update jsii-srcmak #3081
  • chore: fix assertion of java tests #3079
  • chore: add wget #3075
  • chore: use gh cli to create PRs #3074
  • chore(deps): roll back trusted workflow updates #3073
  • chore: add gradle as a dependency for our tests #3066
  • chore: new lookup functionality changes assertion #3065
  • chore: update terraform versions we test again #3064
  • chore: add link to performance page #3060
  • chore(examples): update TS examples to use explicit imports #3053
  • chore: update tfe docs as well #3050
  • chore: remove waiting-on-answer label on comments #3046
  • chore(deps): pin trusted workflows based on HashiCorp TSCCR #3040
  • chore: add workflow to rollout provider documentation #3039
  • chore: clean up code a bit #3037
  • chore: fix links in README #3016

fix

  • fix: provider add java integration test failures due to test setup #3083
  • fix: Gradle related provider add/list/upgrade #3080
  • fix(cli): cdktf debug to read gradle package versions #3077
  • fix(provider-generator): Handle */ in docstrings better, try 3 #3076
  • fix(lib): improve error message for passing an app to a construct #3062
  • fix(tests): remove only in test suite 😅 #3055
  • fix: install pipenv in Docker #3052
  • fix: install python3-venv and pin base image #3049
  • fix: correctly handle if version constraint is defined as star #3045
  • fix: fix single quote escaping #3018
  • fix(hcl2cdk): correctly keep escape sequences for interpolations in template expressions #3017
  • fix(examples): Properly set the Aspect on the stack instead of on the S3Bucket only #3003

feat

  • feat(hcl2cdk): use Fn.lookupNested() instead of propertyAccess() #3056
  • feat(cli): move java template to gradle #3048
  • feat(cli): support gradle projects in provider add and list #3047
  • feat(docs): Link Registry docs blog post #3043
  • feat: remove root-level import of all modules in python #3030
  • feat(provider-generator): handle 'tuple' type for variable #2964

Breaking changes

Python performance improvements disable root-level provider imports

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()

Don't miss a new terraform-cdk release

NewReleases is sending notifications on new releases.