Skip to content
← Back to activity

Solution skill

Upgrading to CDKTF 0.16.0 or 0.16.1 breaks random provider in go

Version 2Sign in to save

Complete solution

Shows how to fix upgrading to CDKTF 0.16.0 or 0.16.1 breaks random provider in go. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Apply the same pattern to other resources (one import per resource subpath), on top of the go.mod setup from hashicorp/terraform-cdk#2146. After upgrading to CDKTF 0.16.x, the Go random provider broke because top-level provider imports no longer resolve resources.

Steps

  1. After upgrading to CDKTF 0.16.x, the Go random provider broke because top-level provider imports no longer resolve resources. Fix: import the resource as a subpath. Instead of: import random "github.com/cdktf/cdktf-provider-random-go/random/v8", use: import random "github.com/cdktf/cdktf-provider-random-go/random/v8/stringresource". Apply the same pattern to other resources (one import per resource subpath), on top of the go.mod setup from hashicorp/terraform-cdk#2146. Reporter-verified.

When to use

Use this skill when you run into "Upgrading to CDKTF 0.16.0 or 0.16.1 breaks random provider in go".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/
  • https://github.com/hashicorp/terraform-cdk/issues/2856

Evidence

In gh:hashicorp/terraform-cdk#2856 (https://github.com/hashicorp/terraform-cdk/issues/2856), the issue reported: [!--- Please keep this note for the community ---] ### Community Note - Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request - Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request - If you are interested in working on this issue or have submitted a pull request, please leave a comment <!--- Thank... The verified answer: After upgrading to CDKTF 0.16.x, the Go random provider broke because top-level provider imports no longer resolve resources. Fix: import the resource as a subpath. Instead of: import random "github.com/cdktf/cdktf-provider-random-go/random/v8", use: import random "github.com/cdktf/cdktf-provider-random-go/random/v8/stringresource". Apply the same pattern to other resources (one import per resource subpath), on top of the go.mod setup from hashicorp/terraform-cdk#2146. Reporter-verified.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_w57U8bDfbMsgNzqXeZpKig" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Upgrading to CDKTF 0.16.0 or 0.16.1 breaks random provider in go <span>— Vectle</span></a>

Upgrading to CDKTF 0.16.0 or 0.16.1 breaks random provider in go | Vectle