diff --git a/docs/releases/1.22-NOTES.md b/docs/releases/1.22-NOTES.md index 7d44c35903..1fce3a1717 100644 --- a/docs/releases/1.22-NOTES.md +++ b/docs/releases/1.22-NOTES.md @@ -136,6 +136,8 @@ For file assets, it means adding an explicit path as shown below: * The `node-role.kubernetes.io/master` and `kubernetes.io/role` labels are deprecated and might be removed from control plane nodes in kOps 1.23. +* The `TerraformJSON` feature flag is deprecated and will be removed in kOps 1.23. Only native HCL2 Terraform output will be supported. + * Due to lack of maintainers, the Aliyun/Alibaba Cloud support has been deprecated. The current implementation will be left as-is until the implementation needs updates or otherwise becomes incompatible. At that point, it will be removed. We very much welcome anyone willing to contribute to this cloud provider. * Due to lack of maintainers, the CloudFormation support has been deprecated. The current implementation will be left as-is until the implementation needs updates or otherwise becomes incompatible. At that point, it will be removed. We very much welcome anyone willing to contribute to this target. diff --git a/upup/pkg/fi/cloudup/terraform/target.go b/upup/pkg/fi/cloudup/terraform/target.go index 68dc8d9f39..052a69c782 100644 --- a/upup/pkg/fi/cloudup/terraform/target.go +++ b/upup/pkg/fi/cloudup/terraform/target.go @@ -17,6 +17,7 @@ limitations under the License. package terraform import ( + "errors" "fmt" "io/ioutil" "os" @@ -83,6 +84,10 @@ func tfGetProviderExtraConfig(c *kops.TargetSpec) map[string]string { func (t *TerraformTarget) Finish(taskMap map[string]fi.Task) error { var err error if featureflag.TerraformJSON.Enabled() { + if featureflag.TerraformManagedFiles.Enabled() { + // Terraform's JSON representation doesn't support provider aliases which are required for managed files + return errors.New("TerraformJSON cannot be used with TerraformManagedFiles") + } err = t.finishJSON() } else { err = t.finishHCL2()