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

Google provider: No module named google.google_compute_region_security_policy #3752

Open
1 task
cyber-francis opened this issue Oct 25, 2024 · 2 comments
Open
1 task
Labels
bug Something isn't working new Un-triaged issue pre-built providers Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager

Comments

@cyber-francis
Copy link

Expected Behavior

{
"cdktf": "0.20.8",
"providers": {
   "google": "~>6.8.0",
   "google-beta": "~>6.8.0",
  }
}

cdktf get runs perfectly. But, then within my python code, I can't import this lib:
from imports.google.google_compute_region_security_policy import GoogleComputeRegionSecurityPolicy

google_compute_region_security_policy exists in the vanilla terraform, but not in cdktf.

Actual Behavior

No module named imports.google.google_compute_region_security_policy

Steps to Reproduce

  1. create a cdktf.json file with below parameters:
{
"cdktf": "0.20.8",
"providers": {
   "google": "~>6.8.0",
   "google-beta": "~>6.8.0",
  }
}
  1. cdktf get
  2. from imports.google.google_compute_region_security_policy import GoogleComputeRegionSecurityPolicy

Versions

google@>6.8.0
google-beta@
>6.8.0
cdktf-cdktf-provider-google: terraform provider version: 5.36.0, prebuilt provider version: 13.25.0

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
@cyber-francis cyber-francis added bug Something isn't working new Un-triaged issue pre-built providers Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager labels Oct 25, 2024
@DanielMSchmidt
Copy link
Contributor

It seems like you have the google provider in your cdktf.json as well as the pre-built provider in your project. This is normally not what you want to do, you should either remove the local one or the pre-built one.

Other than that I do believe for resources the imports omit the provider name, so the import would be from imports.google.compute_region_security_policy import ComputeRegionSecurityPolicy

@xiehan xiehan changed the title PROVIDER_NAME: google Google provider: No module named google.google_compute_region_security_policy Nov 4, 2024
@cyber-francis
Copy link
Author

I removed it, but this module doesn't exits. The compute region security policy. Please, can you confirm if you tried it and it worked for you?

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 pre-built providers Issues around pre-built providers managed at https://github.com/hashicorp/cdktf-repository-manager
Projects
None yet
Development

No branches or pull requests

2 participants