terraform-cdk
terraform-cdk copied to clipboard
Google provider: No module named google.google_compute_region_security_policy
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
- create a cdktf.json file with below parameters:
{
"cdktf": "0.20.8",
"providers": {
"google": "~>6.8.0",
"google-beta": "~>6.8.0",
}
}
- cdktf get
- 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
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