• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Terraform
  • Install
  • Tutorials
    • About the Docs
    • Configuration Language
    • Terraform CLI
    • Terraform Cloud
    • Terraform Enterprise
    • CDK for Terraform
    • Provider Use
    • Plugin Development
    • Registry Publishing
    • Integration Program
  • Registry(opens in new tab)
  • Try Cloud(opens in new tab)
  • Sign up
Terraform Home

CDK for Terraform

Skip to main content
  • CDK for Terraform
  • Get Started
    • Overview
    • Upgrading to Version 0.15
    • Upgrading to Version 0.13
    • Upgrading to Version 0.12
    • Upgrading to Version 0.11
    • Upgrading to Version 0.10
    • Upgrading to Version 0.9
    • Upgrading to Version 0.7
    • Upgrading to Version 0.6
  • Community
  • Telemetry

  • Resources

  • Tutorial Library
  • Certifications
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  • Terraform Registry
    (opens in new tab)
  1. Developer
  2. Terraform
  3. CDK for Terraform
  4. Release
  5. Upgrading to Version 0.15
  • CDK For Terraform
  • v0.14.x
  • v0.13.x
  • v0.12.x
  • v0.11.x
  • v0.10.x
  • v0.9.x
  • v0.8.x

»Upgrading to CDK for Terraform Version 0.15

0.15 is primarily focused around CLI improvements targeted at a better Terraform Cloud integration. Because of this, there are only smaller breaking changes in this release. The most notable one is a renaming of some interfaces / classes in our core library. Some configuration classes were suffixed inconsistently with Config, Props or Options and were renamed to Config for consistency. These classes need to be used in C#, Java, and Go, therefore we have a breaking change in these languages.

Minimum version of Terraform increased to 1.2

CDKTF is bumping the minimum supported version of Terraform from 1.0 to 1.2 starting from CDKTF version 0.15. This change is necessary as CDKTF 0.15 uses the Terraform CLI for planning and applying changes for Terraform Cloud and Terraform Enterprise instead of the API used in version 0.14.

Terraform promises compatibility between all v1.x releases, so there shouldn't be any issues with this change. The only changes between these versions are bug fixes, and new feature additions.

Please open an issue if you encounter any issues or bugs with this change.

Renaming of *Options and *Props to *Config

We had several exports where the configuration passed to constructs or functions was using a class with a different suffix then Config. If you are using a language like C#, Java, or Go you might have needed to specify these classes in your CDKTF application. To simplify the usage we changed every suffix to be Config, so if you currently use one of the others please rename them to use the Config suffix. No options were changed in the process, only the names were aligned.

C#

using vpc; // a local module
class MyStack : TerraformStack
  {
      public MyStack(Construct scope, string name) : base(scope, name)
      {
-          Vpc vpc = new Vpc(this, "vpc", new VpcOptions {
+          Vpc vpc = new Vpc(this, "vpc", new VpcConfig {
              Name = "vpc",
              PublicSubnets = new string[] {"10.0.1.0/24", "10.0.2.0/24"}
          });
      }
  }

Java

import software.constructs.Construct;
import com.hashicorp.cdktf.App;
import com.hashicorp.cdktf.TerraformStack;
import com.hashicorp.cdktf.CloudBackend;
-import com.hashicorp.cdktf.CloudBackendProps;
+import com.hashicorp.cdktf.CloudBackendConfig;
import com.hashicorp.cdktf.NamedCloudWorkspace;

    public static class Demo extends TerraformStack{

        public Demo(Construct scope, String id){
            super(scope, id);
-            new CloudBackend(this, CloudBackendProps.builder()
+            new CloudBackend(this, CloudBackendConfig.builder()
                    .organization("hashicorp")
                    .workspaces(new NamedCloudWorkspace("demo"))
                    .build()
            );

Go

package main
import (
    "github.com/hashicorp/terraform-cdk/examples/go/aws/generated/eks"
    "github.com/hashicorp/terraform-cdk/examples/go/aws/generated/hashicorp/aws/awsprovider"
    "github.com/hashicorp/terraform-cdk/examples/go/aws/generated/hashicorp/aws/ec2"
    "github.com/aws/constructs-go/constructs/v10"
    "github.com/aws/jsii-runtime-go"
    "github.com/hashicorp/terraform-cdk-go/cdktf"
)
func NewExampleCdktfGoAwsStack(scope constructs.Construct, id string) cdktf.TerraformStack {
    stack := cdktf.NewTerraformStack(scope, &id)
    awsprovider.NewAwsProvider(stack, jsii.String("aws"), &awsprovider.AwsProviderConfig{
        Region: jsii.String("us-east-1"),
    })

-   eks.NewEks(stack, jsii.String("EKS"), &eks.EksOptions{
+ eks.NewEks(stack, jsii.String("EKS"), &eks.EksConfig{
        ClusterName:    jsii.String("my-eks"),
        Subnets:        jsii.Strings("a", "b"),
        VpcId:          jsii.String("id"),
        ClusterVersion: jsii.String("1.17"),
    })
    return stack
}

Deprecation: We deprecate the feature flags that go into the context field of the cdktf.json file

CDKTF used to use feature flags to enable potentially breaking behaviors in a release. These are no longer needed since most of the changes we introduce from here can not be hidden behind feature flags. When the feature flags are removed, the behavior will be the same as this configuration:

{
  "context": {
    "excludeStackIdFromLogicalIds": "true",
    "allowSepCharsInLogicalIds": "true"
  }
}
Edit this page on GitHub

On this page

  1. Upgrading to CDK for Terraform Version 0.15
  2. Minimum version of Terraform increased to 1.2
  3. Renaming of *Options and *Props to *Config
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)