Skip to content

Instantly share code, notes, and snippets.

@ivanfavi
Created September 30, 2022 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivanfavi/667d1d4cf7a52e09c62eb135b89fa34b to your computer and use it in GitHub Desktop.
Save ivanfavi/667d1d4cf7a52e09c62eb135b89fa34b to your computer and use it in GitHub Desktop.
cloudflare_rate_limit_issue
tfp -target="cloudflare_rate_limit.register_managed_challenge"
2022-09-30T12:37:15.307+0200 [INFO] Terraform version: 1.2.8
2022-09-30T12:37:15.307+0200 [DEBUG] using github.com/hashicorp/go-tfe v1.0.0
2022-09-30T12:37:15.307+0200 [DEBUG] using github.com/hashicorp/hcl/v2 v2.12.0
2022-09-30T12:37:15.307+0200 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2022-09-30T12:37:15.307+0200 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
2022-09-30T12:37:15.307+0200 [DEBUG] using github.com/zclconf/go-cty v1.11.0
2022-09-30T12:37:15.307+0200 [INFO] Go runtime version: go1.18.1
2022-09-30T12:37:15.307+0200 [INFO] CLI args: []string{"/home/ivan/.tfenv/versions/1.2.8/terraform", "plan", "-target=cloudflare_rate_limit.register_managed_challenge"}
2022-09-30T12:37:15.307+0200 [DEBUG] Attempting to open CLI config file: /home/ivan/.terraformrc
2022-09-30T12:37:15.307+0200 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2022-09-30T12:37:15.307+0200 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2022-09-30T12:37:15.307+0200 [DEBUG] ignoring non-existing provider search directory /home/ivan/.terraform.d/plugins
2022-09-30T12:37:15.307+0200 [DEBUG] ignoring non-existing provider search directory /home/ivan/.local/share/terraform/plugins
2022-09-30T12:37:15.307+0200 [DEBUG] ignoring non-existing provider search directory /usr/share/ubuntu/terraform/plugins
2022-09-30T12:37:15.307+0200 [DEBUG] ignoring non-existing provider search directory /usr/share/gnome/terraform/plugins
2022-09-30T12:37:15.307+0200 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2022-09-30T12:37:15.307+0200 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2022-09-30T12:37:15.307+0200 [DEBUG] ignoring non-existing provider search directory /var/lib/snapd/desktop/terraform/plugins
2022-09-30T12:37:15.307+0200 [INFO] CLI command args: []string{"plan", "-target=cloudflare_rate_limit.register_managed_challenge"}
2022-09-30T12:37:15.520+0200 [DEBUG] checking for provisioner in "."
2022-09-30T12:37:15.520+0200 [DEBUG] checking for provisioner in "/home/ivan/.tfenv/versions/1.2.8"
2022-09-30T12:37:15.521+0200 [INFO] backend/local: starting Plan operation
2022-09-30T12:37:16.661+0200 [DEBUG] created provider logger: level=debug
2022-09-30T12:37:16.662+0200 [INFO] provider: configuring client automatic mTLS
2022-09-30T12:37:16.674+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.24.0/linux_amd64/terraform-provider-cloudflare_v3.24.0 args=[.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.24.0/linux_amd64/terraform-provider-cloudflare_v3.24.0]
2022-09-30T12:37:16.675+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.24.0/linux_amd64/terraform-provider-cloudflare_v3.24.0 pid=266369
2022-09-30T12:37:16.675+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.24.0/linux_amd64/terraform-provider-cloudflare_v3.24.0
2022-09-30T12:37:16.678+0200 [INFO] provider.terraform-provider-cloudflare_v3.24.0: configuring server automatic mTLS: timestamp=2022-09-30T12:37:16.678+0200
2022-09-30T12:37:16.694+0200 [DEBUG] provider: using plugin: version=5
2022-09-30T12:37:16.694+0200 [DEBUG] provider.terraform-provider-cloudflare_v3.24.0: plugin address: address=/tmp/plugin1453138068 network=unix timestamp=2022-09-30T12:37:16.694+0200
2022-09-30T12:37:16.715+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-09-30T12:37:16.716+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.24.0/linux_amd64/terraform-provider-cloudflare_v3.24.0 pid=266369
2022-09-30T12:37:23.252+0200 [DEBUG] ProviderTransformer: "cloudflare_rate_limit.login_users (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2022-09-30T12:37:23.257+0200 [DEBUG] Starting graph walk: walkPlan
2022-09-30T12:37:23.258+0200 [DEBUG] ReferenceTransformer: "data.terraform_remote_state.api_tokens_production" references: []
2022-09-30T12:37:23.258+0200 [DEBUG] Initializing remote state backend: gcs
data.terraform_remote_state.api_tokens_production: Reading...
2022-09-30T12:37:23.258+0200 [DEBUG] ReferenceTransformer: "data.terraform_remote_state.rivalo_production" references: []
2022-09-30T12:37:23.258+0200 [DEBUG] Initializing remote state backend: gcs
2022-09-30T12:37:23.258+0200 [DEBUG] Initializing remote state backend: gcs
data.terraform_remote_state.rivalo_production: Reading...
2022-09-30T12:37:23.258+0200 [DEBUG] Initializing remote state backend: gcs
data.terraform_remote_state.api_tokens_production: Read complete after 1s
2022-09-30T12:37:23.832+0200 [DEBUG] created provider logger: level=debug
2022-09-30T12:37:23.832+0200 [INFO] provider: configuring client automatic mTLS
data.terraform_remote_state.rivalo_production: Read complete after 1s
2022-09-30T12:37:23.847+0200 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.24.0/linux_amd64/terraform-provider-cloudflare_v3.24.0 args=[.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.24.0/linux_amd64/terraform-provider-cloudflare_v3.24.0]
2022-09-30T12:37:23.847+0200 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.24.0/linux_amd64/terraform-provider-cloudflare_v3.24.0 pid=266601
2022-09-30T12:37:23.847+0200 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.24.0/linux_amd64/terraform-provider-cloudflare_v3.24.0
2022-09-30T12:37:23.851+0200 [INFO] provider.terraform-provider-cloudflare_v3.24.0: configuring server automatic mTLS: timestamp=2022-09-30T12:37:23.851+0200
2022-09-30T12:37:23.867+0200 [DEBUG] provider: using plugin: version=5
2022-09-30T12:37:23.867+0200 [DEBUG] provider.terraform-provider-cloudflare_v3.24.0: plugin address: address=/tmp/plugin2074913850 network=unix timestamp=2022-09-30T12:37:23.866+0200
2022-09-30T12:37:23.892+0200 [WARN] ValidateProviderConfig from "provider[\"registry.terraform.io/cloudflare/cloudflare\"]" changed the config value, but that value is unused
2022-09-30T12:37:23.893+0200 [DEBUG] ReferenceTransformer: "cloudflare_rate_limit.register_managed_challenge" references: []
cloudflare_rate_limit.register_managed_challenge: Refreshing state... [id=ofuscated_manually]
2022-09-30T12:37:23.895+0200 [DEBUG] provider.terraform-provider-cloudflare_v3.24.0: Cloudflare API Request Details:
---[ REQUEST ]---------------------------------------
GET /client/v4/zones/ofuscated_manually/rate_limits/ofuscated_manually HTTP/1.1
Host: api.cloudflare.com
User-Agent: terraform/1.2.8 terraform-plugin-sdk/2.10.1 terraform-provider-cloudflare/dev
Authorization: [redacted]
Content-Type: application/json
Accept-Encoding: gzip
-----------------------------------------------------: timestamp=2022-09-30T12:37:23.895+0200
2022-09-30T12:37:24.951+0200 [DEBUG] provider.terraform-provider-cloudflare_v3.24.0: Cloudflare API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Cf-Cache-Status: DYNAMIC
Cf-Ray: 752c52b14a845b74-FRA
Content-Type: application/json; charset=UTF-8
Date: Fri, 30 Sep 2022 10:37:24 GMT
Server: cloudflare
Set-Cookie: __cflb=0H28vgHxwvgAQtjUGU56Rb8iNWZVUvXhba4KWLWLGUd; SameSite=Lax; path=/; expires=Fri, 30-Sep-22 13:07:25 GMT; HttpOnly
Set-Cookie: __cfruid=52d8a14600c4e98932451e6dc6639c28589fe179-1664534244; path=/; domain=.api.cloudflare.com; HttpOnly; Secure; SameSite=None
Vary: Accept-Encoding
X-Envoy-Upstream-Service-Time: 2
{
"result": {
"id": "ofuscated_manually",
"disabled": false,
"description": "Protect register with managed challenge",
"match": {
"request": {
"methods": [
"POST"
],
"schemes": [
"HTTP",
"HTTPS"
],
"url": "www.rivalo.com/register"
},
"response": {
"origin_traffic": true,
"headers": [
{
"name": "Cf-Cache-Status",
"op": "ne",
"value": "HIT"
}
]
}
},
"login_protect": false,
"threshold": 10,
"period": 60,
"action": {
"mode": "managed_challenge",
"timeout": 0
}
},
"success": true,
"errors": [],
"messages": []
}
-----------------------------------------------------: timestamp=2022-09-30T12:37:24.951+0200
2022-09-30T12:37:24.952+0200 [DEBUG] provider.terraform-provider-cloudflare_v3.24.0: Read Cloudflare Rate Limit from API as struct: {ID:ofuscated_manually Disabled:false Description:Protect register with managed challenge Match:{Request:{Methods:[POST] Schemes:[HTTP HTTPS] URLPattern:www.rivalo.com/register} Response:{Statuses:[] OriginTraffic:0xc000958cfd Headers:[{Name:Cf-Cache-Status Op:ne Value:HIT}]}} Bypass:[] Threshold:10 Period:60 Action:{Mode:managed_challenge Timeout:0 Response:<nil>} Correlate:<nil>}: @module=cloudflare tf_rpc=ReadResource @caller=github.com/cloudflare/terraform-provider-cloudflare/internal/provider/resource_cloudflare_rate_limit.go:277 tf_provider_addr=registry.terraform.io/cloudflare/cloudflare tf_req_id=e9ed7bd1-9b2f-b4be-73be-134554272ee5 tf_resource_type=cloudflare_rate_limit timestamp=2022-09-30T12:37:24.951+0200
2022-09-30T12:37:24.959+0200 [WARN] Provider "registry.terraform.io/cloudflare/cloudflare" produced an invalid plan for cloudflare_rate_limit.register_managed_challenge, but we are tolerating it because it is using the legacy plugin SDK.
The following problems may be the cause of any confusing errors from downstream operations:
- .bypass_url_patterns: planned value cty.SetValEmpty(cty.String) for a non-computed attribute
- .action[0].timeout: planned value cty.NumberIntVal(0) for a non-computed attribute
2022-09-30T12:37:24.960+0200 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2022-09-30T12:37:24.961+0200 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/cloudflare/cloudflare/3.24.0/linux_amd64/terraform-provider-cloudflare_v3.24.0 pid=266601
2022-09-30T12:37:24.961+0200 [DEBUG] provider: plugin exited
2022-09-30T12:37:24.962+0200 [DEBUG] building apply graph to check for errors
2022-09-30T12:37:24.963+0200 [DEBUG] adding implicit provider configuration provider["terraform.io/builtin/terraform"], implied first by data.terraform_remote_state.api_tokens_production (expand)
2022-09-30T12:37:24.964+0200 [DEBUG] ProviderTransformer: "cloudflare_rate_limit.login_users (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/cloudflare/cloudflare"]
2022-09-30T12:37:24.967+0200 [INFO] backend/local: plan operation completed
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# cloudflare_rate_limit.register_managed_challenge will be updated in-place
~ resource "cloudflare_rate_limit" "register_managed_challenge" {
id = "ofuscated_manually"
# (6 unchanged attributes hidden)
~ match {
~ response {
~ origin_traffic = true -> false
# (2 unchanged attributes hidden)
}
# (1 unchanged block hidden)
}
# (1 unchanged block hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
│ Warning: Resource targeting is in effect
│ You are creating a plan with the -target option, which means that the result of this plan may not represent all of the changes requested by the current configuration.
│ The -target option is not for routine use, and is provided only for exceptional situations such as recovering from errors or mistakes, or when Terraform specifically suggests to use it as part of an error message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment