-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Cannot create google_cloudfunctions2_function without providing the location attribute #12487
Comments
@AlfatahB the location is required for this resource. Do you set it like other common attributes like project, zone etc. in the provider, or environment variables? Once you provide defaults for them, they thus become optional for most of resources/data source. Does this make sense? |
@edwardmedia I've provided a region in the provider block. Even after providing region in the provider block, I get the same error i.e. Malformed URL error. Yes we can explore your approach of providing location in the provider block itself and support location via the environment too. For now we have kept the location required for the new data-source. |
@melinath shouldn't |
It seems like location should probably be a required field. |
Or we should allow a way to specify a default, like we do for project and some other fields. |
Changing the label from bug to enhancement for triage |
Same issue for me. I provided the region in providers config. This resource should get location field from that. |
Locations and regions are not always the same thing, so we're now avoiding inferring |
Implemented this change for the 5.0 release. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform Version
Terraform v1.2.8
Affected Resource(s)
Terraform Configuration Files (if applicable)
Issue Description
While I was creating the datasource for google_cloudfunctions2_function, I found out that we cannot read the cloudfunctions2_function using the read function of resource file without providing the location attribute. When I dig down into this, I also got 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.
References
The text was updated successfully, but these errors were encountered: