-
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
Path matcher default_route_action conflicts with default_url_redirect #6967
Path matcher default_route_action conflicts with default_url_redirect #6967
Comments
@wastrachan can you try moving |
That I can. If I remove If I move
|
@wastrachan here is how default_route_action should be used, along with other attributes. I think ` https://www.terraform.io/docs/providers/google/r/compute_url_map.html |
@edwardmedia I think perhaps there might be some documentation inconsistency then. The docs show that
This description is consistent with what appears to be available in GCP. So I suspect that either:
Any insight? |
@wastrachan i agreed the doc is not super clear. There are a lot of fields they are interrelated. Below is the original doc. Hope this might be helpful. I do see you can set https://cloud.google.com/compute/docs/reference/rest/v1/urlMaps |
Thanks @edwardmedia, this is helpful to review. So looking at the official REST docs, this is the section that stands out:
I've definitely not tried to make any calls to the REST API directly, however, I don't see any indication that this would conflict with the root I do see in the documentation that there is a conflict between Perhaps there is an exception returned and it's not documented, but without any such documentation it appears that a conflict between the a root |
@wastrachan here is what API docs says (search by defaultUrlRedirect)
https://cloud.google.com/compute/docs/reference/rest/v1/urlMaps |
@edward2a I'm still nearly positive this is referring to a conflict withing the current scope. To prove this, I captured the API request Terraform generated and modified it to include the defaultRouteAction we've been discussion: curl -X PUT -H "Authorization: Bearer XXXXXX" -H "Content-Type: application/json" \
https://compute.googleapis.com/compute/v1/projects/XXXXXX-prod/global/urlMaps/prod-lb-https?alt=json -d '
{
"defaultUrlRedirect": {
"hostRedirect": "https://www.domain.com",
"pathRedirect": "/",
"redirectResponseCode": "FOUND",
"stripQuery": true
},
"fingerprint": "z3wNwBm0jCI=",
"hostRules": [
{
"hosts": [
"domain.com",
"testbed.domain.com"
],
"pathMatcher": "prod"
},
{
"hosts": [
"quotetest.domain.com",
"quotes.domain.com"
],
"pathMatcher": "quotes"
}
],
"name": "prod-lb-https",
"pathMatchers": [
{
"defaultService": "https://www.googleapis.com/compute/v1/projects/XXXX-prod/global/backendServices/appserver",
"name": "prod"
},
{
"defaultService": "https://www.googleapis.com/compute/v1/projects/XXXX-prod/global/backendServices/appserver",
"name": "quotes",
"defaultRouteAction": {
"urlRewrite": {
"pathPrefixRewrite": "/quickquote/",
}
}
},
]
}
' Which does work: {
"id": "1379902350757441315",
"name": "operation-1597116876224-5ac91c0127906-616f3936-99cbe243",
"operationType": "update",
"targetLink": "https://www.googleapis.com/compute/v1/projects/XXXX-prod/global/urlMaps/prod-lb-https",
"targetId": "4896982770880303153",
"status": "RUNNING",
"user": "XXXXXX",
"progress": 0,
"insertTime": "2020-08-10T20:34:36.697-07:00",
"startTime": "2020-08-10T20:34:36.716-07:00",
"selfLink": "https://www.googleapis.com/compute/v1/projects/XXXX-prod/global/operations/operation-1597116876224-5ac91c0127906-616f3936-99cbe243",
"kind": "compute#operation"
} The result of the operation was then verified with a GET to the selected resource: curl -X GET -H "Authorization: Bearer XXXXXXXXXXX" -H "Content-Type: application/json" \
https://compute.googleapis.com/compute/v1/projects/XXXXXX-prod/global/urlMaps/prod-lb-https\?alt\=json
{
"id": "4896982770880303153",
"creationTimestamp": "2020-08-05T10:39:42.977-07:00",
"name": "prod-lb-https",
"selfLink": "https://www.googleapis.com/compute/v1/projects/XXXXX-prod/global/urlMaps/prod-lb-https",
"hostRules": [
{
"hosts": [
"domain.com",
"testbed.domain.com"
],
"pathMatcher": "prod"
},
{
"hosts": [
"quotetest.domain.com",
"quotes.domain.com"
],
"pathMatcher": "quotes"
}
],
"pathMatchers": [
{
"name": "prod",
"defaultService": "https://www.googleapis.com/compute/v1/projects/XXXXXXX-prod/global/backendServices/appserver"
},
{
"name": "quotes",
"defaultService": "https://www.googleapis.com/compute/v1/projects/XXXXXXX-prod/global/backendServices/appserver",
"defaultRouteAction": {
"urlRewrite": {
"pathPrefixRewrite": "/quickquote/"
}
}
}
],
"defaultUrlRedirect": {
"hostRedirect": "https://www.domain.com",
"pathRedirect": "/",
"redirectResponseCode": "FOUND",
"stripQuery": true
},
"fingerprint": "6L_iRebz9kU=",
"kind": "compute#urlMap"
} I don't know how I can more conclusively demonstrate that this should work in Terraform, but I'm happy to keep throwing stuff over the fence. Anything else I can provide to back my claim up? I do appreciate your time on this-- I know it's tempting just to dismiss bug reports like this, and you've been very patient as I make my case-- so thank you! |
@wastrachan I see. Looks like current Terraform behavior differently. Thank you @wastrachan for reporting this. I am inviting @c2thorn to take another look. |
Thanks for your patience @wastrachan! Turns out this was definitely unintentional. The fix will take some time to propagate to a release (looks like it will end up in v3.37). |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
google
provider 3.33.0Affected Resource(s)
Terraform Configuration Files
Debug Output
https://u.pcloud.link/publink/show?code=XZkqYGkZiEiVoOr87lYOtrUzQJ9R9BMz7Cf7
Encrypted per https://www.hashicorp.com/security for privacy
695A7F5DEA640DF326CF3BF019458EC7CC6028D6
Expected Behavior
I expect the plan to apply, creating both a default URL redirect for the URL map, and a default route action for my selected path matcher.
Actual Behavior
The terraform run fails with the following output:
Steps to Reproduce
terraform apply
Important Factoids
References
This issue seems nearly identical to #6695, although the conflict here is with
default_url_redirect
instead ofdefault_service
path_matchers
conflicts #6721The text was updated successfully, but these errors were encountered: