Open steffencircle opened 2 months ago
Hi @steffencircle!
You have a couple of things that we don't have access to. To replicate this issue please provide your data, locals and variables values, if they have sensitive information just specify that we can use any value for them. But also consider that by not having this information you will have to double check certain information on your own since we do not have access to those values.
On the other hand:
Private Service Connect
your project name, or what is it for you?psc-forwarding-rule-001
the initial name of your current google_compute_forwarding_rule
?google_compute_forwarding_rule
? If that is the case share with us the initial configuration of this resource.
Community Note
Terraform Version & Provider Version(s)
Terraform v1.5.7 on windows_amd64. linux_amd64
Affected Resource(s)
google_compute_forwarding_rule
Terraform Configuration
Debug Output
No response
Expected Behavior
The resource should be re-created when used as a Private Service Connect Endpoint and the value for target gets changed after an initial apply. A Patch is not supported.
From the API docs:
For Private Service Connect forwarding rules that forward traffic to managed services, the target must be a service attachment. The target is not mutable once set as a service attachment.
Actual Behavior
The Provider tries to update the resource, which fails with the following error:
Error: Error updating ForwardingRule "projects/landing-project/regions/europe-west3/forwardingRules/psc-forwarding-rule-001": googleapi: Error 400: Invalid value for field 'target.target': 'https://compute.googleapis.com/compute/v1/projects/my-project/regions/europe-west3/serviceAttachments/k8s-api-reverse-proxy'. Cross project referencing is not allowed for this resource., invalid
Steps to reproduce
1.) Deploy a Forwarding rule with Target set to a ServiceAttachment 2.) Change the target 3.) Run terraform apply
Important Factoids
No response
References
No response