Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDKTF: Cannot Get "dev_overrides" Provider Properly #3754

Open
1 task done
jackchuka opened this issue Oct 26, 2024 · 0 comments
Open
1 task done

CDKTF: Cannot Get "dev_overrides" Provider Properly #3754

jackchuka opened this issue Oct 26, 2024 · 0 comments
Labels
bug Something isn't working new Un-triaged issue

Comments

@jackchuka
Copy link

jackchuka commented Oct 26, 2024

Expected Behavior

Successfully creates binding for dev_overrides providers.

Actual Behavior

failed to add custom/provider via cdktf provider add custom/provider. (*I'm masking provider name with custom/provider, the one I'm building is not public yet)
I've also tried followings, but no matter what I do it tries to lookup public registry.

  • setting TF_CLI_CONFIG_FILE=~/.terraformrc
  • using --force-local flag with cdktf get
❯ cdktf provider add custom/provider
(node:17756) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[2024-10-26T16:03:47.122] [INFO] default - Checking whether pre-built provider exists for the following constraints:
  provider: custom/provider
  version : latest
  language: go
  cdktf   : 0.20.8

[2024-10-26T16:03:47.250] [INFO] default - Pre-built provider does not exist for the given constraints.
[2024-10-26T16:03:47.250] [INFO] default - Adding local provider registry.terraform.io/custom/provider with version constraint undefined to cdktf.json
Usage Error: Could not find a version for the provider 'registry.terraform.io/custom/provider' in the public registry. This could be due to a typo, please take a look at https://cdk.tf/registry-providers to find all supported providers.

my terraformrc

❯ bat ~/.terraformrc
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /Users/jackchuka/.terraformrc
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ provider_installation {
   2   │ 
   3   │   dev_overrides {
   4   │       "registry.terraform.io/custom/provider"= "/Users/jackchuka/.local/share/mise/installs/go/1.23.2/bin"
   5   │   }
   6   │ 
   7   │   # For all other providers, install them directly from their origin provider
   8   │   # registries as normal. If you omit this, Terraform will _only_ use
   9   │   # the dev_overrides block, and so no other providers will be available.
  10   │   direct {}
  11   │ }
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Steps to Reproduce

  1. create a custom provider

  2. register via dev_overrides

  3. confirm it's able to terraform plan/apply, etc...

  4. create cdktest stack

cd cmd/terraform-provider-platform             

❯ mkdir cdktest

❯ cd cdktest

❯ cdktf init --template="go" --local
(node:17582) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Note: By supplying '--local' option you have chosen local storage mode for storing the state of your stack.
This means that your Terraform state file will be stored locally on disk in a file 'terraform.<STACK NAME>.tfstate' in the root of your project.
? Project Name cdktest
? Project Description A simple getting started project for cdktf.
? Do you want to send crash reports to the CDKTF team? Refer to 
https://developer.hashicorp.com/terraform/cdktf/create-and-deploy/configuration-file#enable-crash-reporting-for-the-cli for more 
information no
  1. add my custom provider
❯ cdktf provider add custom/provider

Versions

❯ node -v
v20.6.1

❯ terraform version
Terraform v1.9.8
on darwin_arm64

❯ cdktf --version
0.20.8

Providers

No response

Gist

No response

Possible Solutions

No response

Workarounds

No response

Anything Else?

No response

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

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
@jackchuka jackchuka added bug Something isn't working new Un-triaged issue labels Oct 26, 2024
@jackchuka jackchuka changed the title COMPONENT: short issue description CDKTF: Cannot Get "dev_overrides" Provider Properly Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new Un-triaged issue
Projects
None yet
Development

No branches or pull requests

1 participant