-
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
Invalid value for field 'resource.rateLimitOptions.enforceOnKeyName' when field is not set #13804
Invalid value for field 'resource.rateLimitOptions.enforceOnKeyName' when field is not set #13804
Comments
@bfrunza I see the same. This check is done on the API. Why do you think it is wrong?
|
I see where is the problem is. enforceOnKeyName needs to be added in this case
|
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
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
Terraform v1.3.9
on darwin_arm64
Affected Resource(s)
google_compute_security_policy
Terraform Configuration Files
* the version of the config before the change
* the version of the config after the change.
Debug Output
2023-02-22T10:36:35.707+0200 [INFO] provider.terraform-provider-google_v4.53.1_x5: 2023/02/22 10:36:35 [DEBUG] Google API Request Details:
---[ REQUEST ]---------------------------------------
POST /compute/v1/projects/float-sandbox/global/securityPolicies/bfrunza-test/patchRule?alt=json&prettyPrint=false&priority=10502 HTTP/1.1
Host: compute.googleapis.com
User-Agent: google-api-go-client/0.5 Terraform/1.3.9 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/4.53.1
Content-Length: 330
Content-Type: application/json
X-Goog-Api-Client: gl-go/1.18.1 gdcl/0.105.0
Accept-Encoding: gzip
{
"action": "rate_based_ban",
"description": "",
"headerAction": {},
"match": {
"expr": {
"expression": "request.path.matches('/svc/api3/v3')"
}
},
"preview": true,
"priority": 10502,
"rateLimitOptions": {
"banDurationSec": 60,
"conformAction": "allow",
"enforceOnKey": "IP",
"exceedAction": "deny(429)",
"rateLimitThreshold": {
"count": 200,
"intervalSec": 60
}
}
}
-----------------------------------------------------: timestamp=2023-02-22T10:36:35.706+0200
2023-02-22T10:36:36.474+0200 [INFO] provider.terraform-provider-google_v4.53.1_x5: 2023/02/22 10:36:36 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 400 Bad Request
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Wed, 22 Feb 2023 08:36:36 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0
{
"error": {
"code": 400,
"message": "Invalid value for field 'resource.rateLimitOptions.enforceOnKeyName': ''. Enforce on key name cannot be set when the key type is IP.",
"errors": [
{
"message": "Invalid value for field 'resource.rateLimitOptions.enforceOnKeyName': ''. Enforce on key name cannot be set when the key type is IP.",
"domain": "global",
"reason": "invalid"
}
]
}
}
Expected Behavior
The terraform apply command should run successfully
Actual Behavior
The terraform apply command fails with an error
Steps to Reproduce
terraform apply
using the configuration before the changeterraform apply
using the configuration after the changeThe text was updated successfully, but these errors were encountered: