-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Variable transformation on google_workbench_instance leads to Bad Request (HTTP 400) #17904
Variable transformation on google_workbench_instance leads to Bad Request (HTTP 400) #17904
Comments
This error indicates that something with the
I suggest you to check those resources and see if they exists and their configuration(zone, location, project, roles, permissions, and so on) |
Hello @ggtisc, thank you for your response! I can confirm that the resources do indeed exist. As mentioned earlier in the issue, the identical request succeeds when sent via curl or the console (using Just to prove that this network exists, here is the output of the {
"kind": "compute#network",
"id": "567715592102256480",
"creationTimestamp": "2024-04-12T04:57:03.926-07:00",
"name": "vpc-d-shared-restricted",
"selfLink": "https://www.googleapis.com/compute/v1/projects/prj-d-shared-restricted-9enw/global/networks/vpc-d-shared-restricted",
"selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/prj-d-shared-restricted-9enw/global/networks/567715592102256480",
"autoCreateSubnetworks": false,
"subnetworks": [
"https://www.googleapis.com/compute/v1/projects/prj-d-shared-restricted-9enw/regions/us-central1/subnetworks/sb-d-shared-restricted-us-central1",
"https://www.googleapis.com/compute/v1/projects/prj-d-shared-restricted-9enw/regions/us-west1/subnetworks/sb-d-shared-restricted-us-west1"
],
"peerings": [
...
],
"routingConfig": {
...
},
"networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL"
} |
This is effectively as the official documentation you shared describes. There aren't another current way to reference the |
Upon reviewing the debug output linked below at line 40, We can see that the network attribute underwent transformation into a URL before being sent to the Google API Server:
My hypothesis is that this transformation is causing the issue, preventing me from creating the resource through the Terraform provider. The behaviour I observed on my tests before opening this issue was:
|
This is an internal harassment, but according to the official documentation the only thing you need to do is declare the resources as they are on these links: This ticket was replicated again from scratch with the provided version without errors |
Yes it does work on most of the times, for example, I was able to create the same instance in a different project and using the same network. The odd thing is that the provider does change the format of the parameter to an undocumented format, and in the project mentioned above, I get the error. Being able to create this resource with the same parameters but using a manual curl request to the same endpoint or through the Google Cloud Console instead of using the Terraform Provider, strongly suggests that this issue is not a misconfiguration issue but a provider issue. Here are more details about the experiment I made: https://gist.github.com/caetano-colin/02e66f73af472e6a6f9c141e577a65af Please don't hesitate to reach out if there's anything further I can assist you with regarding this matter. I'm fully committed to providing my best effort to help resolve this problem. |
In this case it can be a proposal for a future implementation. But for now the unique available configurations are those |
I`m also facing the same issue. |
same problem here |
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.7.5
Affected Resource(s)
Terraform Configuration
Debug Output
https://gist.github.com/caetano-colin/8435956b49b1eb761ac51653f1727f58
Expected Behavior
The workbench_instance should deploy succesfully using the specified network/subnetwork set.
Actual Behavior
I received a 400 bad request and the input format changed from projects/{projectId}/global/networks/{network_id} to an URL.
It seems like the URL is not an expected field according to this document:
https://cloud.google.com/vertex-ai/docs/workbench/reference/rest/v2/projects.locations.instances#NetworkInterface
Steps to reproduce
terraform apply
Important Factoids
projects/{projectId}/global/networks/{network_id}
, works fineReferences
https://cloud.google.com/vertex-ai/docs/workbench/reference/rest/v2/projects.locations.instances#NetworkInterface
I'm not 100% sure, but it seems like this is the part of the provider source code responsible for transforming the variable to an URL:
b/338447520
The text was updated successfully, but these errors were encountered: