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 "me too" comments, 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. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.
Description
While I was creating the data source for google_artifact_registry_repository, I found out that we cannot read the artifact_registry_repository using the read function of resource file without providing the location attribute. When I dig down into this, I also get the same error while making the create calls without providing the location attribute:
Error: Error creating Repository: googleapi: Error 400: Request contains an invalid argument.
│ Details:
│ [
│ {
│ "@type": "type.googleapis.com/google.rpc.DebugInfo",
│ "detail": "Fail to resolve resource 'projects/crest-359621/locations/' extracted from request field 'parent'.; while enforcing CPE to generate new SecurityContext."
│ }
│ ]
It's working fine if I provide the location attribute in the configuration file.
I think the replaceVars function in the resource files doesn't deal with {{location}} in the string provided and hence if we don't provide location explicitly, than we get the error for the malformed url.
As of now, the probable fix should be to keep the location attribute required.
I think this can be closed now? It appears to work, however, I've noticed a different issue on importing when the location is specified, but is a multi-region location.
Community Note
Description
While I was creating the data source for google_artifact_registry_repository, I found out that we cannot read the artifact_registry_repository using the read function of resource file without providing the location attribute. When I dig down into this, I also get the same error while making the create calls without providing the location attribute:
It's working fine if I provide the location attribute in the configuration file.
I think the replaceVars function in the resource files doesn't deal with {{location}} in the string provided and hence if we don't provide location explicitly, than we get the error for the malformed url.
As of now, the probable fix should be to keep the
location
attribute required.New or Affected Resource(s)
Potential Terraform Configuration
References
12487 Similar Issue
b/272797520