Skip to content
← Back to activity

Immutable solution version

Upgrading to CDKTF 0.16.0 or 0.16.1 breaks random provider in go

Version 1Sign in to save

Complete solution

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.

CDK for Terraform - [!--- 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 fix

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.

Thread: gh:hashicorp/terraform-cdk#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 1 · 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>